C# program to convert uppercase to a lowercase string
Program.cs
string s = "KODIGWINDOW";
Console.WriteLine(s.ToLower());
Output
kodingwindow@kw:~/csharp$ dotnet run
kodigwindow
kodingwindow@kw:~/csharp$ 
C# program to convert uppercase to a lowercase string using ASCII values
Program.cs
string s1 = "KODIGWINDOW";
string s2 = "";
for (int i = 0; i < s1.Length; i++)
{
    if (s1[i] >= 65 && s1[i] <= 92)
        s2 += (char)(s1[i] + 32);
    else
        s2 += s1[i];
}
Console.WriteLine(s2);
Output
kodingwindow@kw:~/csharp$ dotnet run
kodigwindow
kodingwindow@kw:~/csharp$ 
Advertisement