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;
//License from project: Open Source License 

public class Main {
    public static String ltrim(String str) {
        int i = 0;
        while (i < str.length()) {
            switch (str.charAt(i)) {
            case ' ':
            case '\t':
                i++;/*  w ww.  j a v  a  2 s .c  o  m*/
                continue;
            }
            break;
        }
        return str.substring(i);
    }
}

Related

  1. ltrim(String s, Character c)
  2. ltrim(String source)
  3. ltrim(String source)
  4. ltrim(String source)
  5. ltrim(String src, char ch, int nLen)
  6. ltrim(String str)
  7. ltrim(String str)
  8. ltrim(String str)
  9. ltrim(String str, String charList)