List of utility methods to do String Leading Character
String | addLeadingCharacter(String s, char c, int len) Adds specified leading characters to the specified length. if (s != null) { StringBuffer sb = new StringBuffer(); int count = len - s.length(); for (int i = 0; i < count; i++) { sb.append(c); sb.append(s); return sb.toString(); ... |
String | addLeadingCharacter(String s, char c, int len) Adds specified leading characters to the specified length. while (s != null && s.length() < len) { s = c + s; return s; |
String | addLeadingSlash(String fileName) Adds the leading slash if needed on the beginning of a filename. if (fileName.startsWith("/")) { return fileName; return "/" + fileName; |
String | addLeadingSlash(String fileName) add Leading Slash return addLeadingUnixSlash(fileName);
|
String | addLeadingSlash(String path) Ensures the given chunk path starts with a leading slash if (path == null) { return null; if (!path.isEmpty() && path.charAt(0) == '/') { return path; return "/" + path; |
String | addLeadingSlash(String path) add Leading Slash return path.startsWith("/") ? path : "/" + path; |
String | addLeadingSlash(String string) add Leading Slash if (string == null) throw new NullPointerException("string must not be null"); if (string.startsWith("/")) return string; return "/" + string; |
String | addLeadingSpace(String s, int len) Adds leading spaces to the given string to the specified length. return addLeadingCharacter(s, ' ', len); |
String | addLeadingSpace(String s, int len) Adds leading spaces to the given String to the specified length. return addLeadingCharacter(s, ' ', len); |
String | addLeadingUnixSlash(String fileName) Adds the leading slash if needed on the beginning of a filename. if (fileName.startsWith("/")) { return fileName; return "/" + fileName; |