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
Post a Comment