Java String Trim Left ltrim(String source)

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

Description

remove leading whitespace

License

LGPL

Parameter

Parameter Description
source a parameter

Return

string without leading whitespace

Declaration

public static String ltrim(String source) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    /**//from w  w w  .j  av  a 2 s .c  o  m
     * remove leading whitespace
     * 
     * @param source
     * @return string without leading whitespace
     */
    public static String ltrim(String source) {
        return source.replaceAll("^\\s+", "");
    }
}

Related

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