2
I need to know if the first character of a string
is capitalized and does not let the program follow.
How to do?
Console.Write("Digite o nome do " + i + "º rei: " );
kings[i] = Console.ReadLine();
while ((kings[i].Length < 1 || kings[i].Length > 20 ) )
{
Console.WriteLine("O nome está inválido");
Console.Write("Digite novamente");
kings[i] = Console.ReadLine();
}
Yours is not working
– gabrielfalieri
I believe you did something wrong so I put link in the answer showing that it works. The only thing I had wrong is that I needed to reverse the condition and give the output.
– Maniero
Dei Ctrl c, Ctrl v in my project, it is not validating the first capital letter
– gabrielfalieri
I think you need to analyze what you are doing. Programming is not copying and pasting, it is understanding what is happening with the code. I put in two different fonts showing that it works. Obviously I had to change the code to be able to compile, after all you did not put all the code, if you had put all of it I could help more. I can’t rewrite all your code, because I would have to guess what it is, so I can put something that you can paste and compile without changes.
– Maniero