Extract digits from string – StringUtils Java
Use this code numberOnly will contain your desired output. String str=”sdfvsdf68fsdfsf8999fsdf09″; String numberOnly= str.replaceAll(“[^0-9]”, “”);
Use this code numberOnly will contain your desired output. String str=”sdfvsdf68fsdfsf8999fsdf09″; String numberOnly= str.replaceAll(“[^0-9]”, “”);
StringUtils.isBlank() checks that each character of the string is a whitespace character (or that the string is empty or that it’s null). This is totally different than just checking if the string is empty. From the linked documentation: Checks if a String is whitespace, empty (“”) or null. StringUtils.isBlank(null) = true StringUtils.isBlank(“”) … Read more