c# if string does not contain code example
Example 1: if string contains number c#
"abc3def".Any(c => char.IsDigit(c));
// Or to make it shorter:
"abc3def".Any(char.IsDigit);
Example 2: c# string contains
bool b = s1.Contains("myString");
"abc3def".Any(c => char.IsDigit(c));
// Or to make it shorter:
"abc3def".Any(char.IsDigit);
bool b = s1.Contains("myString");