Hi ravi,
You can use isNumeric() or isNumericSpace() method to find a string is number or not
String num = ‘23456789;
System.assert(num.isNumeric());
this will check string without space
String numSpace = ‘5 4 6 8’;
System.assert(numSpace.isNumericspace());
this will include spaces also.