C# program to convert given string to upper case
Following program shows you how to convert given string to upper case.
In this program we get string from user and convert that string to upper case using .ToUpper()
using System;
class MainClass {
public static void Main (string[] args) {
Console.WriteLine("Please enter a string:");
string input = Console.ReadLine();
string upperCase = input.ToUpper();
Console.WriteLine("Given string to upper case: " + upperCase);
}
}
Output:
Please enter a string:
abcd
Given string to upper case: ABCD