LOWERCASE
try
{
string s = "This Is A Sentence!!!";
char[] ca = s.ToCharArray();
foreach (char c in ca)
{
if ((int)c < 91 && (int)c > 64)
Console.Write(((char)((int)c + 32)));
else
Console.Write(c);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
UPPERCASE
try
{
string s = "This Is A Sentence!!!";
char[] ca = s.ToCharArray();
foreach (char c in ca)
{
if ((int)c < 123 && (int)c > 96)
Console.Write(((char)((int)c - 32)));
else
Console.Write(c);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
try
{
string s = "This Is A Sentence!!!";
char[] ca = s.ToCharArray();
foreach (char c in ca)
{
if ((int)c < 91 && (int)c > 64)
Console.Write(((char)((int)c + 32)));
else
Console.Write(c);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
UPPERCASE
try
{
string s = "This Is A Sentence!!!";
char[] ca = s.ToCharArray();
foreach (char c in ca)
{
if ((int)c < 123 && (int)c > 96)
Console.Write(((char)((int)c - 32)));
else
Console.Write(c);
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}