Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

determine if is string or int

string str = "3257fg";
for(int i = 0;i < (strlen(str) - 1);i++) {
    if((int)str[i] < 10) {
        // it is a number, so do some code
    } else {
        // it is not a number, do something else
    }
}
Source by www.cplusplus.com #
 
PREVIOUS NEXT
Tagged: #determine #string #int
ADD COMMENT
Topic
Name
5+5 =