Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# how to check string is number

string s1 = "123";
string s2 = "abc";

bool isNumber = int.TryParse(s1, out int n); // returns true
isNumber = int.TryParse(s2, out int n); // returns false
 
PREVIOUS NEXT
Tagged: #check #string #number
ADD COMMENT
Topic
Name
8+3 =