New String Methods with JDK 11

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 titleMethodDescription
String::lineslines()"String instance method that uses a specialized Spliterator to lazily provide lines from the source string."
String::stripstrip()Evolution of trim() now based on Unicode
String::stripLeadingstripLeading()removes white space from the beginning (Unicode)
String::stripTrailingstripTrailing()removes white space from the end (Unicode)
String::isBlankisBlank()"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

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.