Basically I'm just trying to check if a user input is all uppercase or lowercase. Currently my problems are that the code returns true1 or true2 every iteration and if the input is all uppercase the first for loop breaks into the next loop which- since none of the letters are lowercase - returns false. Sorry if this problem is formatted incorrectly, I'm quite new.
namespace CheckifSameCase
{
class Program
{
static void Main(string[] args)
{
//Initialize user input as var "input".
string str = Console.ReadLine();
char[] characters = str.ToCharArray();
//This for loop iterates through the user input and checks if all letters are uppercase.
//if not all letters are uppercase then the loop breaks to the next loop.
for (int i = 0; i < characters.Length; i++)
{
if (char.IsUpper(characters[i]))
{
Console.WriteLine("True1");
}
else
{
break;
}
}
//This for loop checks for lowcase letters and returns false if all letters aren't lowercase.
for (int i = 0; i < characters.Length; i++)
{
if (char.IsLower(characters[i]))
{
Console.WriteLine("True2");
}
else
{
Console.WriteLine("False");
break;
}
}
}
}
}