Fixed #14. Added support for leftTrim function

This commit is contained in:
Shekhar Gulati
2016-05-21 18:05:13 +05:30
parent ce81fb1070
commit 19fed40aac
2 changed files with 16 additions and 1 deletions
+10 -1
View File
@@ -602,7 +602,16 @@ public abstract class Strman {
return value.toLowerCase().lastIndexOf(needle.toLowerCase(), offset);
}
/**
* Removes all spaces on left
*
* @param value The input String
* @return String without left border spaces
*/
public static String leftTrim(final String value) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
return value.replaceAll("^\\s+", "");
}
public static String decode(final String value, final int digits, final int radix) {
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);