Check if character is number?

前端 未结 22 758
误落风尘
误落风尘 2020-12-03 00:29

I need to check whether justPrices[i].substr(commapos+2,1).

The string is something like: \"blabla,120\"

In this case it would check whether \'0

22条回答
  •  悲哀的现实
    2020-12-03 00:43

    square = function(a) {
        if ((a * 0) == 0) {
            return a*a;
        } else {
            return "Enter a valid number.";
        }
    }
    

    Source

提交回复
热议问题