Answers for "c check if string is numeric only"

C#
2

c# check if string is all numbers

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

c check if char is number

char c = 'a'; // or whatever

if (isalpha(c)) {
    puts("it's a letter");
} else if (isdigit(c)) {
    puts("it's a digit");
} else {
    puts("something else?");
}
Posted by: Guest on June-09-2020

Code answers related to "c check if string is numeric only"

C# Answers by Framework

Browse Popular Code Answers by Language