public static bool TryParse(string s, IFormatProvider provider, out PhoneNumber result) { return TryParse(s, out result); }
/// <summary> /// Tries to parse the supplied string into the supplied <see cref="PhoneNumber"/> object. /// </summary> /// <param name="s">The string to parse.</param> /// <param name="result">The <see cref="PhoneNumber"/> object.</param> /// <returns>True if the parsing is successful, false otherwise.</returns> public static bool TryParse(string s, out PhoneNumber result) { if (string.IsNullOrEmpty(s)) { result = Empty; return true; } if (!Expression.IsMatch(s)) { result = Empty; return false; } result = new PhoneNumber(s); return true; }