Here you can find the source of ltrim(String str)
public static String ltrim(String str)
//package com.java2s; //License from project: Open Source License public class Main { public static String ltrim(String str) { int i = 0; while (i < str.length()) { switch (str.charAt(i)) { case ' ': case '\t': i++;/* w ww. j a v a 2 s .c o m*/ continue; } break; } return str.substring(i); } }