Home
Manage Your Code
Snippet: method to validate string is alphanumberic (C#)
Title: method to validate string is alphanumberic Language: C#
Description: Check a string if it is only alpha numeric by using a regular expression Views: 206
Author: Steve Vasquez Date Added: 8/8/2008
Copy Code  
1public bool IsAlphaNumeric(String str)
2{
3  Regex regexAlphaNum=new Regex("[^a-zA-Z0-9]");
4  return !regexAlphaNum.IsMatch(str);    
5}