Java String Trim Left leftTrimSlashes(String s)

Here you can find the source of leftTrimSlashes(String s)

Description

Returns the specified string with all leading slashes removed.

License

Open Source License

Parameter

Parameter Description
s the input string

Return

the trimmed string

Declaration

public static String leftTrimSlashes(String s) 

Method Source Code

//package com.java2s;
/**// w w w.  j a  va2  s  .  co m
 * Copyright (c) 2011 Martin Geisse
 *
 * This file is distributed under the terms of the MIT license.
 */

public class Main {
    /**
     * Returns the specified string with all leading slashes removed.
     * @param s the input string
     * @return the trimmed string
     */
    public static String leftTrimSlashes(String s) {
        while (s.startsWith("/")) {
            s = s.substring(1);
        }
        return s;
    }
}

Related

  1. lefttrim(String str)
  2. leftTrim(String str)
  3. leftTrim(String string)
  4. leftTrim(String value)
  5. leftTrim(StringBuilder pStringBuilder)
  6. ltrim(byte[] a)
  7. ltrim(CharSequence str)
  8. ltrim(final String str)
  9. ltrim(final String str, final char filler)