将 HTML 元素内的多个空格替换为
我有大量类似于
<div>some text</div>
具有多个空格 的 html,我想将其替换为
<div>some text</div>
有没有办法使用像 notepad++/dreamweaver 这样的 HTML 编辑器来执行此操作?我的问题是仅隔离尾随/后续文本的空格。
I have large amounts of html similar to
<div>some text</div>
with multiple whitespaces, which I would like to replace with
<div>some text</div>
Is there a way to do this an HTML editor like notepad++/dreamweaver? My problem is isolating only the whitespaces trailing/following text.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如评论者提到的,它应该是
。
您应该能够进行简单的查找和替换,用
替换空格。 Notepad++肯定有这个功能。
需要意识到的一件事是 nbsp 代表不间断空格,或者换句话说,是一个永远不允许换行的空格。如果您有一大段包含所有 nbsp 的文本,它将全部显示在一行上,并且可能需要水平滚动才能阅读。
As the commenter mentioned, it should be
.
You should be able to do a simple find and replace, replacing space with
. Notepad++ definitely has this feature.
One thing to realize is that nbsp stands for non-breaking space, or put another way, a space that will never allow a line break. If you have a large block of text with all nbsp's, it will all appear on one line and may require horizontal scrolling to read.
如果您正在寻找使用任何编辑器并修改 HTML,那么您可以使用替换 notepad++ 的所有功能。
打开全部替换对话框的快捷方式是Ctrl +H。在此对话框中,您应该输入要查找的字符串和要替换的字符串,然后单击“替换”。
我希望这对你有意义。您不需要 JavaScript 来执行此操作。
If you are looking for using any editor and modify your HTML then you can use replace all feature of notepad++.
The short cut to open replace all dialog box is Ctrl +H. In this dialog box you should enter the string to find and string to replace with and then click on replace.
I hope this makes sense to you. You don't need javascript to do this.
像这样?
Like this?