C# string to alphanumeric
Short and easy way to get the alphanumeric content of a string:
public static string ToAlphaNumeric(this string str)
{
return new string(str.Where(c => char.IsLetterOrDigit(c)).ToArray());
}
Just another WordPress codeblog on C#, Silverlight and all things .NET
Short and easy way to get the alphanumeric content of a string:
public static string ToAlphaNumeric(this string str)
{
return new string(str.Where(c => char.IsLetterOrDigit(c)).ToArray());
}