Java String Strip stripLeadingSlash(String str)

Here you can find the source of stripLeadingSlash(String str)

Description

strip Leading Slash

License

Open Source License

Declaration

public static String stripLeadingSlash(String str) 

Method Source Code

//package com.java2s;

import java.util.List;

public class Main {
    public static String stripLeadingSlash(String str) {
        if (!isEmpty(str) && str.startsWith("/")) {
            return str.substring(1);
        } else {//  w w w .  ja  v  a2s .c  om
            return str;
        }
    }

    public static boolean isEmpty(String str) {
        return str == null || "".equals(str.trim());
    }

    public static boolean isEmpty(List list) {
        return list == null || list.size() == 0;
    }

    public static boolean isEmpty(StringBuilder sb) {
        return sb == null || isEmpty(sb.toString());
    }
}

Related

  1. strip(String string, String token)
  2. stripBadHTMLTags(String s)
  3. stripClassFromClassName(String className)
  4. stripExtension(String filename)
  5. stripLastElement(String str)
  6. stripNamespaceDeclarations(String xml)
  7. stripTags(final String tagged)
  8. stripTags(String html)
  9. stripTags(String in)