Char - ToLower
Converts the value of a Unicode character to its lowercase equivalent.
public static void Main() { char [] input = {'.','N','E','T','4','.','7','.','2'}; Console.WriteLine("Converted all the characters to lower case."); for (int i = 0; i < input.Length; i++) { // C# Extension Method: Char - ToLower var result = input[i].ToLower(); 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 lowercase 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 lowercase equivalent of , modified according to , or the unchanged value of , if is already lowercase or /// not alphabetic. /// </returns> public static Char ToLower(this Char c, CultureInfo culture) { return Char.ToLower(c, culture); } /// <summary> /// Converts the value of a Unicode character to its lowercase equivalent. /// </summary> /// <param name="c">The Unicode character to convert.</param> /// <returns> /// The lowercase equivalent of , or the unchanged value of , if is already lowercase or not alphabetic. /// </returns> public static Char ToLower(this Char c) { return Char.ToLower(c); } }