Here you can find the source of ltrim(String str)
public static String ltrim(String str)
//package com.java2s; public class Main { public static String ltrim(String str) { return ltrim(str, " "); }//from w w w . ja v a 2 s . c o m public static String ltrim(String str, String remove) { if (str == null || str.length() == 0 || remove == null || remove.length() == 0) { return str; } while (str.startsWith(remove)) { str = str.substring(remove.length()); } return str; } }