Billy Korando ๐Ÿƒโ˜•๏ธ ๐Ÿˆ๐Ÿˆ Profile picture
#Java Developer Advocate @Oracle โ˜•๏ธ๐Ÿฅ‘. @KCJUG co-organizer. Formerly; @IBM, @KeyholeSoftware, @niprcom. Opinions are my own. Trolled by @briseida_ko ๐Ÿ’

Apr 22, 2022, 7 tweets

Hey #Java Developers, โ˜•๏ธ

It's your #SipOfJava Friday thread! ๐Ÿงต

String is one of the most often utilized JDK classes by Java developers. Let's take a look at how String has been improved in recent Java releases, as well as some over looked features from older releases.

1/7

Text Blocks were added in Java 15, and introduce the concept of a 2-dimensional String. Text Blocks greatly improve the experience of working with markup languages like; XML, JSON, HTML, as Strings.

2/7

The String classes has seen a lot of work done to it since JDK 8, with many new helper methods being added. Check out this Sip of Java were I cover some of the key new additions.

3/7

Needing to join a bunch of strings together into a list, but hate dealing with how to handle that last item? Use the StringJoiner API, which was part of JDK 8!

4/7

Needing to search a large chunk of text for a piece of information? Consider using the find APIs, part of the Scanner API.

5/7

Alternatively, needing to break apart a large String by one of more delimiters? Then consider using the tokenize API also part of the Scanner API.

6/7

Happy Coding!

7/7

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling