I read a string that includes all types of characters. I want to check whether there is in the string, consisting of sub-string at least 7 digits. What is the best way to do it?
use a regular expression
[0-9]{7,}
bool includesPhone = Regex.IsMatch("phone number 123456789", "[0-9]{7,}");
Use Regex - something like \d{7,}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With