Here you can find the source of ltrim(String s)
Parameter | Description |
---|---|
s | a parameter |
public static String ltrim(String s)
//package com.java2s; public class Main { /**//from w ww . ja v a 2 s .co m * Trims specified string from left. * @param s */ public static String ltrim(String s) { if (s == null) { return null; } int index = 0; int len = s.length(); while (index < len && Character.isWhitespace(s.charAt(index))) { index++; } return (index >= len) ? "" : s.substring(index); } }