Char - ToUpper
Converts the value of a specified Unicode character to its uppercase equivalent using specified culture specific formatting information.
public static void Main() { char [] input = {'E','n','t','i','t','y',' ','F','r','a','m','e','w','o','r','k',' ','6','.','2'}; Console.WriteLine("Converted all the characters to upper case."); for (int i = 0; i < input.Length; i++) { // C# Extension Method: Char - ToUpper var result = input[i].ToUpper(); Console.WriteLine("{0} : {1} ", input[i], result); } }
View Source
using System; using System.Globalization; public static partial class Extensions { /// <summary> /// Converts the value of a specified Unicode character to its uppercase equivalent using specified culture- /// specific formatting information. /// </summary> /// <param name="c">The Unicode character to convert.</param> /// <param name="culture">An object that supplies culture-specific casing rules.</param> /// <returns> /// The uppercase equivalent of , modified according to , or the unchanged value of if is already uppercase, /// has no uppercase equivalent, or is not alphabetic. /// </returns> public static Char ToUpper(this Char c, CultureInfo culture) { return Char.ToUpper(c, culture); } /// <summary> /// Converts the value of a Unicode character to its uppercase equivalent. /// </summary> /// <param name="c">The Unicode character to convert.</param> /// <returns> /// The uppercase equivalent of , or the unchanged value of if is already uppercase, has no uppercase /// equivalent, or is not alphabetic. /// </returns> public static Char ToUpper(this Char c) { return Char.ToUpper(c); } }