Valid Number
STRING
MATH

Problem

Given a string s, determine if it is a valid numeric value. The string can contain integers, decimals, and/or scientific notation (e.g., "10e5"). Consider valid numbers to include integers, floating-point numbers, and numbers in scientific notation.

Examples:

isValidNumber("0.1") // returns true isValidNumber("abc") // returns false isValidNumber("-90e3") // returns true
Loading...