package test; import utils.StringReplaceUtil; public class Test { /** * 增强型替换函数,替换字符串中的字符 * 例如:把字符串中的user替换为pwd,但是username中的user不替换. * @param args */ public static void main(String[] args) { // String str="usernamefddfuserhbfgdhsdfhiuwvmnfnbjkghgirt c,.; user"; // String xx="user"; // String yy=""; // String strr=StringReplaceUtil.replace(str, xx, yy); // System.out.println(strr); String str="usernamxfddfuserhbfgdhsdfhiuwvmuserxamenfnbjkghgirt c,.; usernam"; String xx="user"; String yy="pwd"; String[] except={"+name"}; String strr=StringReplaceUtil.replace(str, xx, yy,except); System.out.println(strr); // String stet=StringReplaceUtil.getPrefix("user+name"); // String stet=StringReplaceUtil.getSuffix("user+name"); // System.out.println("stet="+stet); } }

skyvsdes LV1
2021年7月29日
jnwkkk LV1
2020年10月8日
李英齐 LV1
2020年10月1日
mengxiangjava LV2
2019年10月20日
墨染青衫 LV2
2019年6月17日
734688149 LV1
2019年6月3日
sxzysh LV1
2019年5月23日
double123456lll LV1
2019年5月5日
ethrtwfd LV1
2019年3月31日
photograph LV1
2018年10月13日