Here you can find the source of ltrim(String s)
public static String ltrim(String s)
//package com.java2s; //License from project: Apache License public class Main { public static String ltrim(String s) { int len = s.length(); int st = 0; char[] val = s.toCharArray(); while ((st < len) && (val[st] <= ' ')) { st++;/*from w w w .j a va 2s . co m*/ } return (st > 0) ? s.substring(st, len) : s; } }