I am trying to see if the string contains a specific format. For example if someone types a phone number 1234567890 I need to force a person to enter a phone number in a specific format.
(###) ###-####. I am make changes to a vended program where the design of the program is terrible where you cannot force the formatting within a form. So, I was wondering if there is a way to use string.contains(“(###) ###-####”) or any other help would be greatly appreciated.
I am trying to see if the string contains a specific format. For example
Share
sounds like you want to use regular expressions (aka Regex) Regex is usually the best route to go when trying to get or check strings against a pattern.
here is MSDN docs and here is a decent how-to on codeproject
a quick google will show you tons and tons of examples,tutorials, and libraries of expressions