在分隔符前后添加和修剪空格
如果字符串包含带有一个特殊字符(分隔符)的文本,
如何在分隔符之前的点之后添加一个空格并修剪分隔符之后的任何空格?
示例字符串:
- .Dolo.rum ipsum primos@ ar.deo
- J.ust。简单的文本@ h er.e
- 另一个 fr.ee @。 exe mpl e
预期结果:
If string contain text with one single special character (separator),
How to ad a space after point before separator and trim any space after separator?
Exemple string:
- .Dolo.rum ipsum primos@ ar.deo
- J.ust. simple text@ h er.e
- Another fr.e.e @. exe mpl e
Expect result:
- . Dolo. rum ipsum [email protected]
- J. ust. simple [email protected]
- Another fr. e. e @.exemple
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于无法删除已接受的答案,因此分享第一条评论中提到的解决方案,
Since an accepted answer can't be deleted hence sharing the solution as mentioned in the first comment,