Bootstrap

将后缀替换成空串或其他replaceAll,replace

将后缀替换成空串或其他

A_SUFFIX, B_SUFFIX, C_SUFFIX 被代替的内容

String str = "abcAdmin"
str= str.replaceAll("(\\w)" + A_SUFFIX + "$", "$1")
                        .replaceAll("(\\w)" + B_SUFFIX + "$", "$1")
                        .replaceAll("(\\w)" + C_SUFFIX + "$", "$1");
                        如要代替Admin,运行结果->str=abc
 $1,标识正则表达式()的占位符,其后面填啥就会替换啥
 如$1Test ->str=abcTest
 感觉这样写会更直观
 .replaceAll("(\\w)" + B_SUFFIX + "$", "$1"+"Test")
  ->str=abcTest

只能用replaceAll,尝试了一下replace不行

;