Java 11 has added A new instance method isBlank()
to java.lang.String
class.
What\'s the basic difference between the exi
The difference is as below :-
isBlank() returns true for the string having only white space characters whereas isEmpty() will return false for such strings.
("\n\r ").isBlank(); //returns true
("\n\r ").isEmpty(); //returns false
For detailed explanation with Code Example visit : isBlank() vs isEmpty() in String class Java