Java String Trim Left ltrim(String str)

Here you can find the source of ltrim(String str)

Description

ltrim

License

Open Source License

Declaration

public static String ltrim(String str) 

Method Source Code

//package com.java2s;

public class Main {

    public static String ltrim(String str) {
        return ltrim(str, " ");
    }//from   w w w  . ja  v  a 2  s . c  o  m

    public static String ltrim(String str, String remove) {
        if (str == null || str.length() == 0 || remove == null || remove.length() == 0) {
            return str;
        }

        while (str.startsWith(remove)) {
            str = str.substring(remove.length());
        }
        return str;
    }
}

Related

  1. ltrim(String source)
  2. ltrim(String src, char ch, int nLen)
  3. ltrim(String str)
  4. ltrim(String str)
  5. ltrim(String str)
  6. ltrim(String str, String charList)
  7. ltrim(String str, String defaultValue)
  8. ltrim(String text, char c)
  9. ltrimCount(final String input)