Here you can find the source of combineSplit(int startIndex, String[] string, String separator)
Parameter | Description |
---|---|
startIndex | The index of String[] to start with |
string | The String[] you wish to combine |
separator | The separator to fill in between each object in String[] |
public static String combineSplit(int startIndex, String[] string, String separator)
//package com.java2s; //License from project: Open Source License public class Main { /**/*w w w.j a v a 2s. c om*/ * Function to combine a String[] into a String * * @param startIndex The index of String[] to start with * @param string The String[] you wish to combine * @param separator The separator to fill in between each object in String[] * @return */ public static String combineSplit(int startIndex, String[] string, String separator) { final StringBuilder builder = new StringBuilder(); for (int i = startIndex; i < string.length; i++) { builder.append(string[i]); builder.append(separator); } builder.setLength(builder.length() - separator.length()); return builder.toString(); } }