string MobileNumber = " + 9 1 1 2 3 4 5 6 7 8 9 "; MobileNumber = Regex.Replace(MobileNumber, @"\s+", "");
static Regex whitespace = new Regex(@"\s+", RegexOptions.Compiled); public static string TrimAllWithRegex(string str) { return whitespace.Replace(str, ""); }
number = number.Replace(" ","");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)