我有一个字符串。
在这个句子中,我想去掉所有出现在标点符号之前的空格,变成这样:
"This is a big sentence . ! ? ! but I have to remove the space ."
在这个句子中,我想去掉所有出现在标点符号之前的空格,变成这样:
"This is a big sentence.!?! but I have to remove the space."
我试图使用"\p{Punct}"
,但无法替换字符串中的内容。