Char - ToUpperInvariant
Converts the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant culture.
public static void Main() { char [] input = {'d','i','ş'}; Console.WriteLine("Converted all the characters to upper case using the casing rules of the invariant culture.."); for (int i = 0; i < input.Length; i++) { // C# Extension Method: Char - ToUpperInvariant var result = input[i].ToUpperInvariant(); Console.WriteLine("{0} : {1} ", input[i], result); } }
View Source
using System; public static partial class Extensions { /// <summary> /// Converts the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant /// culture. /// </summary> /// <param name="c">The Unicode character to convert.</param> /// <returns> /// The uppercase equivalent of the parameter, or the unchanged value of , if is already uppercase or not /// alphabetic. /// </returns> public static Char ToUpperInvariant(this Char c) { return Char.ToUpperInvariant(c); } }