Java examples for java.lang:String Trim
trim a string from left
//package com.java2s; public class Main { public static void main(String[] argv) { String text = "java2s.com"; System.out.println(ltrim(text)); }/*from w ww .j a v a2 s . c o m*/ public static final String ltrim(final String text) { return ltrim(text, null); } public static final String ltrim(final String text, String trimText) { if (text == null) { return null; } if (trimText == null) { trimText = " "; } int pos = 0; for (; pos < text.length(); pos++) { if (trimText.indexOf(text.charAt(pos)) < 0) { break; } } return text.substring(pos); } }