c# - How can I validate a string to only allow alphanumeric characters in it? -


How do I verify a string using regular expressions to allow letters in letters only?

(I do not want to allow any spaces).

Use the expression:

  ^ [a-zA- Z0- 9] * $  

means: using the system. Lesson Regular expression;

  Regex r = New Reggae ("^ [A-GA-Z0-9] * $"); If (r.IsMatch (SomeString)) {...}  

Comments

Popular posts from this blog

SQL/PHP: Table design question -

NHibernate Passing Session to the Repository -

asp.net - How do I pass login ID as parameter to SharePoint login page? -