Check string using contain

Hi,

Because you use ToUpper method and it returns true as Indonesia.

I think it’s better to use regex as the following.

System.Text.RegularExpressions.Regex.IsMatch(varString,"\bDone\b",System.Text.RegularExpressions.RegexOptions.IgnoreCase)

This returns true if “done” (Case ignored) exists as a word.

Regards,

2 Likes