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

 

Related Post

Leave a Reply

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