Here you can find the source of splitStringUsingDelimiter(String name, String delimiter)
public static String splitStringUsingDelimiter(String name, String delimiter)
//package com.java2s; //License from project: Apache License import java.util.Iterator; import java.util.List; public class Main { public static String splitStringUsingDelimiter(String name, String delimiter) { return splitStringUsingDelimiter(name, delimiter, false); }/* w ww . j ava2 s. co m*/ public static String splitStringUsingDelimiter(String name, String delimiter, boolean capped) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < name.length(); i++) { char charAt = name.charAt(i); boolean delimiterAdded = false; if (i > 0 && Character.isUpperCase(charAt)) { buf.append(delimiter); delimiterAdded = true; } if (capped && (i == 0 || delimiterAdded)) buf.append(Character.toUpperCase(charAt)); else buf.append(Character.toLowerCase(charAt)); } return buf.toString(); } public static String toString(List<String> list, String delimiter) { String argumentString = ""; Iterator<String> iterator2 = list.iterator(); for (int i = 0; iterator2.hasNext(); i++) { String argument = iterator2.next(); if (i > 0) argumentString += delimiter; argumentString += argument; } return argumentString; } }