私はC#を初めて使用していますが、なぜこれが機能しないのかわかりません。以前に分割された文字列を分割したい。分割時に暗黙的に文字列[]を文字列に変換できません
私のコードは次のとおりです:
int i;
string s;
string[] temp, temp2;
Console.WriteLine("write 'a-a,b-b,c-c,d-d'";
s = Console.ReadLine();
temp = s.Split(',');
for (i = 0; i < temp.Length; i++)
temp2[i] = temp[i].Split('-');
私が手Cannot implicitly convert type 'string[]' to 'string
は、私が一緒に終了したい、次のエラー:
temp = {a-a , b-b , c-c , d-d};
temp2 = {{a,a},{b,b},{c,c},{d,d}};
申し訳ありませんが、私はC#の初心者です:) – mithril333221
おそらく問題はありませんが、 'Console.WriteLine()'行の最後に ')'を忘れてしまいました。 –