bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/Java/Java Reference
Java•Java Reference

Java String join() Method

❮ String Methods

Example

String fruits = String.join(" ", "Orange", "Apple", "Mango");
System.out.println(fruits);

Definition and Usage

The join() method joins one or more strings with a specified separator.

One of the following

public String join(CharSequence
separator , CharSequence...
elements )
public String join(CharSequence
separator , Iterable
elements )

Parameter Values

ParameterDescription
separatorRequired. The separator used to join the elements
elementsRequired. Elements to be joined

Technical Details

Returns:A new String , separated by the specified separator
Java version:1.8

Previous

Java String isEmpty() Method

Next

Java String lastIndexOf() Method