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

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -