草庐IT

remainingValue

全部标签

java - JAVA中如何去除字符串中的转义字符

我有像"\\{\\{\\{testing}}}"这样的输入字符串,我想删除所有"\"。所需的o/p:“{{{testing}}}”。我正在使用以下代码来完成此任务。protectedStringremoveEscapeChars(Stringregex,StringremainingValue){Matchermatcher=Pattern.compile(regex,Pattern.CASE_INSENSITIVE).matcher(remainingValue);while(matcher.find()){Stringbefore=remainingValue.substring(