Char - IsLetter
Indicates whether the specified Unicode character is categorized as a Unicode letter.
public static void Main() { char [] input = {'.','N','E','T','4','.','7','.','2'}; Console.WriteLine("Is each of the following characters a letter?"); for (int i = 0; i < input.Length; i++) { // C# Extension Method: Char - IsLetter var result = input[i].IsLetter(); Console.WriteLine("{0} : {1} ", input[i], result); } }
View Source
using System; public static partial class Extensions { /// <summary> /// Indicates whether the specified Unicode character is categorized as a Unicode letter. /// </summary> /// <param name="c">The Unicode character to evaluate.</param> /// <returns>true if is a letter; otherwise, false.</returns> public static Boolean IsLetter(this Char c) { return Char.IsLetter(c); } }