Here you can find the source of cloneString(final String toClone)
public static String cloneString(final String toClone)
//package com.java2s; public class Main { public static String cloneString(final String toClone) { if (toClone == null) { return null; }/* ww w. java 2 s.c om*/ if (toClone.isEmpty()) { return new String("").concat(new String("")); } if (toClone.length() == 1) { return String.valueOf(toClone.charAt(0)); } return toClone.substring(0, 1) + toClone.substring(1); } public static int length(final String s, final String separator) { final String[] list = s.split(separator); return list.length; } }