【发布时间】:2012-07-16 04:36:08
【问题描述】:
我有一堆带有标点符号的字符串,我想将它们转换为空格:
"This is a string. In addition, this is a string (with one more)."
会变成:
"This is a string In addition this is a string with one more "
我可以通过 stringr 包 (str_replace_all()) 手动执行此操作,一次一个标点符号 (, / . / ! / ( / ) / etc.),但我很好奇是否有我假设使用正则表达式的更快方法。
有什么建议吗?
【问题讨论】: