Answers for "how to check if string is numbers or letters c#"

C#
2

c# check if string is only letters and numbers

if (textVar.All(c => Char.IsLetterOrDigit(c))) {
    // String contains only letters & numbers
}
Posted by: Guest on May-19-2020
2

c# check if string is all numbers

if (str.All(char.IsDigit)) {
  // String only contains numbers
}
Posted by: Guest on May-13-2020

Code answers related to "how to check if string is numbers or letters c#"

C# Answers by Framework

Browse Popular Code Answers by Language