私はこのコードを持っている:IListに問題があります。固定サイズですか?
IList<string> stelle = stelleString.Split('-');
if (stelle.Contains("3"))
stelle.Add("8");
if (stelle.Contains("4"))
stelle.Add("6");
をしかしIListのは.Split()の後に固定サイズを持っているようだ:System.NotSupportedException:コレクションが固定サイズであったが。
この問題を解決するにはどうすればよいですか?
'string.Split()'は文字列配列を返します。配列は固定サイズなので、例外はあります。 – BoltClock
これは.NETの設計上の決定が悪いためです:http://stackoverflow.com/questions/5968708/why-array-implements-ilist/5968798#5968798 – mbeckish