Here you can find the source of stripLeadingSlash(String str)
public static String stripLeadingSlash(String str)
//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()); } }