Here you can find the source of ltrim(String s)
Parameter | Description |
---|---|
s | the string to ltrim. |
public static String ltrim(String s)
//package com.java2s; public class Main { /**/*from w ww .ja v a 2 s .c o m*/ * Left trims a string. * @param s the string to ltrim. * @return a trimmed string. */ public static String ltrim(String s) { if (s == null) return null; for (int k = 0; k < s.length(); k++) { if (!Character.isWhitespace(s.charAt(k))) return (k == 0 ? s : s.substring(k)); } return ""; } }