Windows 콘솔 응용 프로그램을 사용하여 문장의 단어 수를 계산하려고합니다. 하지만 배열 것은 새로운이야 정말 내가 그 코드로 무엇을 할 수 있는지 모른다 : (단어 == 공간 사이의 모든 문자는) 당신이 뭔가를 구현할 수 쉬운 경우에서System.Array에 길이 정의에 대한 정의가 없습니다
string sentence;
Console.WriteLine("Enter your sentence:");
sentence = Console.ReadLine();
string [] words = sentence.Split(' ');
Console.WriteLine(sentence.Lenght); // .Lenght is where I get the error from
Console.ReadKey();
철자를 잘못 입력 했으므로 '길이'입니다. – Equalsk
길이가 철자로되어 있는데, 길이는 아닙니다. –
문자열에'Length'를 : 배열에'문장'이 아닌'words'라고 부릅니다. 그것은 012.All입니다. Console.WriteLine (words.Length);' – croxy