Empresa engajada
Write a function to check if a given string is a number.
Sigiloso
My code for this question in Java. I assumed number as anything that can be put into an operation in a calculator. if (str == null){ return false; } char[] c = str.toCharArray(); if (c.length() 1 || toTest.equals("-.") || ((isNegative == true || decCount > 0) && c.length ==1)){ return false; } return true;