C# program to convert lowercase to an uppercase string
Program.cs
string s = "GoDarda"; Console.WriteLine(s.ToUpper());
Output
godarda@gd:~/csharp$ dotnet run KODINGWINDOW godarda@gd:~/csharp$
C# program to convert lowercase to an uppercase string using ASCII values
Program.cs
string s1 = "GoDarda"; string s2 = ""; for (int i = 0; i < s1.Length; i++) { if (s1[i] >= 97 && s1[i] <= 122) s2 += (char)(s1[i] - 32); else s2 += s1[i]; } Console.WriteLine(s2);
Output
godarda@gd:~/csharp$ dotnet run KODINGWINDOW godarda@gd:~/csharp$
Comments and Reactions
What Next?
C# program to convert uppercase to a lowercase string
C# program to concatenate the given strings
C# program to reverse the given string
Advertisement