String str = "给商品||?>\\n阳澄湖大闸蟹!@#$%^&*()_+-=?:\",.]\\|~.,\/??\\\\|\\br点赞"
String tradeDescription = "||?>\\n阳澄湖大闸蟹!@#$%^";
String description = "给商品 #goodsName# 点赞";
String result = description.replaceAll("#goodsName#", Matcher.quoteReplacement(CommonUtil.toString(tradeDescription)));
参考:
http://www.colabug.com/thread-1131948-1-1.html