Property and Method

Count 리스트에 원소의 개수를 출력
Add(Value) 리스트에 값을 추가
Insert(Index, Value) 특정 인덱스에 값을 추가
Remove(Value) 리스트에서 값을 제거(값이 중복인 경우 먼저 만나는 값 제거)
RemoveAt(Index) 특정 인덱스의 값을 제거
Clear() 리스트에 모든 값을 제거

‘System.Collections.Generic’

using System.Collections.Generic

List Declaration

List<string> myList = new List<string>();

"Code explanation”


List[Index]

string firstItem = myList[0];

List[index] = Value