Commit b84007a1 authored by yanzg's avatar yanzg

默认日期格式的支持

parent 03306c3c
...@@ -1135,4 +1135,34 @@ public class StringHelper { ...@@ -1135,4 +1135,34 @@ public class StringHelper {
return sb.toString(); return sb.toString();
} }
/**
* 删除开头字符串
*
* @param inStr
* @param prefix
* @return
*/
public static String trimStart(String inStr, String prefix) {
if (inStr.startsWith(prefix)) {
String ret = inStr.substring(prefix.length());
return trimStart(ret, prefix);
}
return inStr;
}
/**
* 删除末尾字符串
*
* @param inStr
* @param suffix
* @return
*/
public static String trimEnd(String inStr, String suffix) {
if (inStr.endsWith(suffix)) {
String ret = inStr.substring(0, inStr.length() - suffix.length());
return trimEnd(ret, suffix);
}
return inStr;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment