Java is always evolving and getting better.
In September 2018 the JDK 11 will be released will have some new methods according to the String object in Java. The following table will show you this methods and will explain their behaviour to you.
Bug title | Method | Description |
---|---|---|
String::lines | lines() | "String instance method that uses a specialized Spliterator to lazily provide lines from the source string." |
String::strip | strip() | Evolution of trim() now based on Unicode |
String::stripLeading | stripLeading() | removes white space from the beginning (Unicode) |
String::stripTrailing | stripTrailing() | removes white space from the end (Unicode) |
String::isBlank | isBlank() | "instance method that returns true if the string is empty or contains only white space" |
Waiting for the JDK 11 and have fun using the methods when released.
Feel free to share
Leave a Reply