Flashcards
Valid Number
Cards in this deck (1)
- 1Validate if a given string is numeric. Some examples: "0" => true " 0.1 " => true "abc" => false "1 a" => false "2e10" => trueclass Solution {
public boolean isNumber(String s) {
if(s == null || s.trim().length() == 0) return false;
s = s.trim();
boolean seenNum = false;
boolean seenD = false;
boolean seenE = false;
for(int i = 0; i
Information
- Description
- Flashcards on Valid Number, created by Suhas S on 23/03/2018.
- Created by
- Suhas S
- Views
- 0
- Rating