I need to check whether justPrices[i].substr(commapos+2,1).
justPrices[i].substr(commapos+2,1)
The string is something like: "blabla,120"
In this case it would check whether '0' is a number. How can this be done?
You could use comparison operators to see if it is in the range of digit characters:
var c = justPrices[i].substr(commapos+2,1); if (c >= '0' && c <= '9') { // it is a number } else { // it isn't }
1.4m articles
1.4m replys
5 comments
57.0k users