Convert String array to string in java

In this article, we’ll look at the String array convert to String. This can be useful for example to log query parameters.

String.join method example

From Java 8, the simplest way do convert is:

StringBuilder example

StringBuilder is thread safe and getting more perfomance benefit over simple String concatenation

 

Leave a Reply

Your email address will not be published.

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