I have been writing about new features of Java SE 8 since it's release in March 2014. Initially, my focus areas on much talked about lambda expressions and streams, but slowly I realize that Java 8 is not just about them. It has many more new features which will help Java developers in their day-to-day job as much lambdas and streams. One of them is the ability to join the String with any delimiter. It has added a class called StringJoiner in java.util package which we have seen earlier, but it has also added a new method on String class, the join() method, which finally allows you to join Strings in Java. You might have faced scenarios in past where you have a list of String or an array of String and you want to join them by a comma. Unfortunately, Java didn't have anything like Android's TextUtils.join() or JavaScript's Array.join() method which can join String on a delimiter.
Read more »