Per the following code I'm trying to strip out any semblance of a phone number out of a string - but all I get is the exact value I send...
The string contains this: "Abbott Laboratories Diag Div ((800) 323-9100)"
Another example of a string that may occur is: (Phone 800-255-8522)
For the most part strings are being passed with just: (Phone: )
so I still need that type stripped out.
The function I have is this:
private static string NoPhoneNumber(string sValue)
string newvalue = "";
if (sValue.IndexOf("(Phone: )") == -1)
newvalue = sValue;
newvalue = sValue.Contains("(Phone: )") ? sValue.Substring(0, sValue.IndexOf("(Phone: )")) : "";
How may I change the syntax above to allow for phone numbers be gone from the string?
Thank you in advance!