Alright, so I'm trying to get the percentage of uppercase letters in a string. However, I'm not having much luck as my current code only says prints out if 100% of the string is uppercase.
int capsCount = 0;
foreach (char c in e.message)
{
if (Char.IsUpper(c))
capsCount++;
}
Console.WriteLine($"{(capsCount/e.message.Replace(" ", string.Empty).Length).ToString("0.00%")} is caps.");
Console.WriteLine($"{e.message.Replace(" ", string.Empty).Length}:{capsCount}");
Output from the console, #sydth is the irc channel, sydth is the username, and test is the message.
#sydth:sydth:TEST
100.00% is caps.
4:4
#sydth:sydth:test
0.00% is caps.
4:0
#sydth:sydth:teST
0.00% is caps.
4:2