Android String Strip stripStart(String str, String stripChars)

Here you can find the source of stripStart(String str, String stripChars)

Description

strip Start

Declaration

public static String stripStart(String str, String stripChars) 

Method Source Code

//package com.java2s;

public class Main {
    public static String stripStart(String str, String stripChars) {
        int strLen;
        if (str == null || (strLen = str.length()) == 0) {
            return str;
        }/*from w  w  w . j  a  v  a 2s.c o m*/
        int start = 0;
        if (stripChars == null) {
            while ((start != strLen)
                    && Character.isWhitespace(str.charAt(start))) {
                start++;
            }
        } else if (stripChars.length() == 0) {
            return str;
        } else {
            while ((start != strLen)
                    && (stripChars.indexOf(str.charAt(start)) != -1)) {
                start++;
            }
        }
        return str.substring(start);
    }
}

Related

  1. stripControlCharacters(Object value)
  2. stripControlCharacters(String value)
  3. stripEnd(String str, String stripChars)
  4. stripEnd(String str, String stripChars)
  5. stripStart(String str, String stripChars)