How to check that string is alphanumeric or not in vb.net and C#

Alphanumeric is a combination of alphabetic and numeric characters.The alphanumeric character set consists of the numbers 0 to 9 and letters A to Z. for example these are the alphanumeric:

1. Author123
2. author5Code
3. 123456TY
4. 897AUTOR
suppose if you want to know that particular string is a alphanumeric or not than you can use following code sample

[VB.Net]

Private Function IsAlphaNum(ByVal strInputText As String) As Boolean
   return System.Text.RegularExpressions.Regex.IsMatch(strInputText, "^[a-zA-Z0-9]+$")
End Function

[C#]

private bool IsAlphaNum(string strInputText)
{
  return System.Text.RegularExpressions.Regex.IsMatch(strInputText, "^[a-zA-Z0-9]+$"); 
}