Java String Trim Left ltrimCount(final String input)

Here you can find the source of ltrimCount(final String input)

Description

ltrim Count

License

Open Source License

Declaration

public static int ltrimCount(final String input) 

Method Source Code

//package com.java2s;

public class Main {
    public static int ltrimCount(final String input) {
        if (input == null)
            return 0;
        if (input.isEmpty())
            return 0;
        int i = 0;
        while (i < input.length() && input.charAt(i) == ' ')
            ++i;//from   w  w w .j  a  v a2  s .  c o  m
        return i;
    }
}

Related

  1. ltrim(String str)
  2. ltrim(String str)
  3. ltrim(String str, String charList)
  4. ltrim(String str, String defaultValue)
  5. ltrim(String text, char c)
  6. ltrimNewline(String s)
  7. ltrimZero(String inputString)