String[] arr = {"Hello", "World"}; String delimiter = "-"; String mergedStr = StringUtil.merge(arr, delimiter); System.out.println(mergedStr); // Output: Hello-World
String[] arr = {"Liferay", "is", "an", "awesome", "platform"}; String delimiter = " "; String mergedStr = StringUtil.merge(arr, delimiter); System.out.println(mergedStr); // Output: Liferay is an awesome platformIn the above example, we are merging the array of strings {"Liferay", "is", "an", "awesome", "platform"} using the delimiter " " (space). This method belongs to the com.liferay.portal.kernel.util package library in Java.