Guest User

Untitled

a guest
Oct 13th, 2015
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.35 KB | None | 0 0
  1. string foo = "Hello!";
  2.  
  3.             foreach (char c in foo)
  4.             {
  5.                 if (Regex.IsMatch(foo, @"^[a-zA-z0-9\.\-]*$"))
  6.                 {
  7.                     Console.WriteLine("match");
  8.  
  9.                 }
  10.                 else
  11.                 {
  12.                     Console.WriteLine("no match");
  13.                 }
  14.             }
Advertisement
Add Comment
Please, Sign In to add comment