Sunday, February 3, 2013

MS C# multi replace



string phone = "800 123-1234";
// Strip "-" and " " from the phone number string.
phone = Regex.Replace(phone, @"[- ]", String.Empty);
Console.WriteLine(phone);
// output: 8001231234;

No comments:

Post a Comment