String how to check character contain digit or not


public class StringDigitFind {
public static void main(String args[]) {

String s="mad4";

for(int i=0;i<s.length();i++) {

//Character number of not
if(Character.isDigit(s.charAt(i))) {
System.out.println("Digit");
}
}

}
}

Comments