Char - IsNumber

Indicates whether the specified Unicode character is categorized as a number.

Try it

public static void Main()
{
    char [] input = {'.','N','E','T','4','.','7','.','2'};

    Console.WriteLine("Is each of the following characters a number?");

    for (int i = 0; i < input.Length; i++)
    {
		// C# Extension Method: Char - IsNumber
		var result = input[i].IsNumber();
		
        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 number.
    /// </summary>
    /// <param name="c">The Unicode character to evaluate.</param>
    /// <returns>true if  is a number; otherwise, false.</returns>
    public static Boolean IsNumber(this Char c)
    {
        return Char.IsNumber(c);
    }
}