Pages

Wednesday, July 6, 2011

Clean Telephone Number with Regular expression

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.Xml;

namespace GOSI.Motion
{
    public class StringUtils
    {
       public static string CleanTelephoneNumber(string inputString)
           {
               return Regex.Replace(inputString, @"[\(\)\-\.\s]", "");
           }
    }
}

No comments:

Post a Comment