I have a string variable in C# and I want to check this string contains letters or not.
I used following regular expression for evaluate this condition, but I returned false in the if statement I used.
I dont know why?
My C# Code:
string cellValue ="Row Merging Done here";
if (Regex.IsMatch(cellValue, @"^[a-zA-Z]+$"))
{
messageBox.show("Message found");
}
How to evalute this regular expression?
Don’t you need to recognize spaces:
@"^[a-zA-Z ]+$"