String - IsAlphaNumeric

A string extension method that query if the string object is Alphanumeric.

Try it

public static void Main()
{
	string [] values = {"EntityFramework6", ".NetCore2.0"};

	foreach(var str in values)
	{
		// C# Extension Method: String - IsAlphaNumeric
    	if(str.IsAlphaNumeric())
		{
			Console.WriteLine("{0} is Alpha Numeric", str);
		}
		else
		{
			Console.WriteLine("{0} is not Alpha Numeric", str);
		}
	}
}

View Source
using System.Text.RegularExpressions;

public static partial class Extensions
{
    /// <summary>
    ///     A string extension method that query if '@this' is Alphanumeric.
    /// </summary>
    /// <param name="this">The @this to act on.</param>
    /// <returns>true if Alphanumeric, false if not.</returns>
    public static bool IsAlphaNumeric(this string @this)
    {
        return !Regex.IsMatch(@this, "[^a-zA-Z0-9]");
    }
}