i have to add validator for password column, i.e. it should not allow "Password" word in Password at any stage.. means "Password@1234" should not be allowed. So i was using below code which is working fine:
Regex.IsMatch(viewModel.Password.ToUpper(), @"(\w*PASSWORD\w*)", RegexOptions.IgnoreCase)
Now i want to compare multiple words means it should not contains "Password" or "Hello" lets say. I have tried ".Any" but it is not working.
if (myList.Any(str => str.Contains("Password")))
I have followed:
Check if a string within a list contains a specific string with Linq
for Any
Please help.