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
you can either use parseInt and than check with isNaN
parseInt
isNaN
or if you want to work directly on your string you can use regexp like this:
function is_numeric(str){ return /^\d+$/.test(str); }