Why am I getting this error:
The name Regex does not exist in the current context.
from my code?
if (Regex.IsMatch(string1, @"^[a-zA-Z]+$"))
Make sure you have the System.Text.RegularExpressions
namespace referenced.
You need to include the right namespace to access the Regex
class:
using System.Text.RegularExpressions;
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