c# regex check if string contains numbers code example
Example: if string contains number c#
"abc3def".Any(c => char.IsDigit(c));
// Or to make it shorter:
"abc3def".Any(char.IsDigit);
"abc3def".Any(c => char.IsDigit(c));
// Or to make it shorter:
"abc3def".Any(char.IsDigit);