日期:2014-05-20 浏览次数:20640 次
"AsABdBCCDDAAsBBsAABBVV".replaceAll("A{2}|B{2}", "")
------解决方案--------------------
String s = "dsBBfvAAxcvAAasxcBBB"; s.replace("AA","").replace("BB","");
------解决方案--------------------
String str = "dsBBfvAAxcvAAasxcBBB"; System.out.println(str.replaceAll("AA|BB",""));
------解决方案--------------------
import org.apache.commons.lang.StringUtils; public class Test{ public static void main(String args[]){ System.out.println(StringUtils.replaceEach("dsBBfvAAxcvAAasxcBBB",new String[]{"AA","BB"}, new String[]{"",""})); } }