Java全部替换?

时间:2018-08-23 12:03:07

标签: java replaceall

我正在尝试替换字符串中的某些字符,但是它不起作用。你能帮我么?

我的代码是:

String test = "ABC?!";
test = test.replaceAll("\\?","");
test= test.replaceAll("\\!, "");

非常感谢您对我的帮助。

1 个答案:

答案 0 :(得分:3)

尝试 $qb->select( 'firstfield', 'secondfield', 'thirdfield', 'fourthfield', )->from(Table, 'u'); $queryHaving = "CONCAT(firstfield, ' ', secondfield, ' ', thirdfield, ' ', fourthfield) regexp 'value'"; $qb->andhaving($queryHaving); $queryHaving = "CONCAT(firstfield, ' ', secondfield, ' ', thirdfield, ' ', fourthfield) regexp 'value2'"; $qb->andhaving($queryHaving);