【发布时间】:2017-01-24 16:37:56
【问题描述】:
例如:
输入String是
Input = "Hello there, How are you? Fine!! @xyz"
输出将是
Output = "Hello there myWord How are you myWord Fine myWord myWord myWord xyz"
我尝试过使用Pattern 类和Matcher 类,但它只替换了一种模式和str.replace(".","myWord");
【问题讨论】:
-
你的意思是所有出现在大括号中的符号,或者大括号也是你要替换的符号?
-
我也想去掉大括号...
标签: java replace pattern-matching replaceall