Java 11 introduced six new methods into the String class. 1️⃣ isBlank() 2️⃣ lines() 3️⃣ repeat() 4️⃣ strip() 5️⃣ stripLeading() 6️⃣ stripTrailing()
5
66
3
417
What if my String is null? they should provide null handling with isBlank() method.
1
These aren’t static methods. So if your String reference is null, then calling isBlank() will be an NPE.

Mar 30, 2022 · 3:01 PM UTC

Absolutely. What I am looking for is a static method within the String class itself similar to StringUtils.isBlank.
1