how to check a number in string

Solutions on MaxInterview for how to check a number in string by the best coders in the world

showing results for - "how to check a number in string"
Kolby
10 Feb 2017
1To find whether a given string contains a number,
2convert it to a character array and find whether 
3each character in the array is a digit using the isDigit() 
4method of the Character class
Ada
06 Oct 2019
1//Add this to your code and call
2static private boolean isMyNumber(String s){
3        try{
4            Integer.parseInt(s);
5            return true;
6        }catch (Exception e){
7            return false;
8        }
9    }
similar questions
queries leading to this page
how to check a number in string