0
중첩 목록의 특정 목록에 값을 추가해야합니다. inputString이라는 값을 가진리스트가 있다면, 그 결과가이리스트에 추가됩니다. 아니요 인 경우 결과가있는 새 목록을 만듭니다. 코드는 다음과 같습니다.중첩 목록의 특정 목록에 값 추가 C#
foreach(List<string> List in returnList)
{
if (List.Contains(inputString))
{
//add a string called 'result' to this List
}
else
{
returnList.Add(new List<string> {result});
}
}
그래서 문제가 무엇입니까? –
'List.Add (result);'?? –
그냥'List.add (result)'를 호출 하시겠습니까? –