JavaScript的:
.replace(/_/g," ");
Run Code Online (Sandbox Code Playgroud)
我在我的代码中有它,但不记得它为什么或它做了什么!你们其中一个正规表达大师能帮忙吗?我知道这可能看起来很基本,但正则表达不是我的一杯茶,谷歌搜索/ g将无济于事......
McK*_*yla 25
像其他人一样,它用空格替换所有下划线.所以"Hello_there."会成为"Hello there."
但随着答案,我想向你提出一些建议.使用评论.
在您的代码中说出如下内容:
// Replaces all underscores so that blah blah blah blah blah..
var hello = "Hello_there."
.replace(/_/g, ' ');
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
78857 次 |
| 最近记录: |