Here you can find the source of leftTrim(final String input, final char charToTrim)
public static String leftTrim(final String input, final char charToTrim)
//package com.java2s; /*/*from w w w . jav a2 s .co m*/ * @author Fabio Zadrozny * Created: June 2005 * License: Common Public License v1.0 */ public class Main { /** * Removes the occurrences of the passed char in the end of the string. */ public static String leftTrim(final String input, final char charToTrim) { final int len = input.length(); int off = 0; final char[] val = input.toCharArray(); while (off < len && val[off] == charToTrim) { off++; } return input.substring(off, len); } }