// all white spaces
s.replaceAll("\\s+", "");
// only nums
s.matches("[0-9]+");
// except nums
s.matches("[^0-9]+");
// onlyLetters
s.matches("[a-zA-Z]+");
// alphaNumeric
^[a-zA-Z0-9]+$
to continue…
// all white spaces
s.replaceAll("\\s+", "");
// only nums
s.matches("[0-9]+");
// except nums
s.matches("[^0-9]+");
// onlyLetters
s.matches("[a-zA-Z]+");
// alphaNumeric
^[a-zA-Z0-9]+$
to continue…