The Char class provides the method ToUpper which will convert the any given character to its corresponding upper case character from lower case character.
The Char.ToUpper accepts the character as parameter and returns the char with the Upper Case .
How to Convert a Character to Upper Case in C# using Char.ToUpper ?
Below is a sample sourcecode demonstrating How to Convert a Character to Upper Case in C# using Char.ToUpper ?
using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string inputString = "Welcome to Abundant Code $"; string outputString = string.Empty; foreach(char input in inputString) { outputString += Char.ToUpper(input); } Console.WriteLine("The uppercase string is " + outputString); Console.Read(); } } }
Leave a Reply