/*****
* original,左边扩充n个"-"
* @param n
* @param original
* @return
*/
private String fullStr(int n,String original){
StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) {
sb.append("|--");
}
sb.append(original);
return sb.toString();
}
public String getCategoryName(){//过滤空格,过滤开头的一个或多个"|--"
if (categoryName != null){
String cateName = categoryName.trim();
String lastStr = cateName.replaceFirst("^(\\|--)*", "");
return lastStr;
}
return null;
}
标签:return,String,--,过滤,sb,字符串,java,original
From: https://www.cnblogs.com/pansidong/p/17877362.html