小编nic*_*ter的帖子

删除   在冷融合中

我有一个叫做 htmlcode 的 var:

  <table width="600" align="center" cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
             <td colspan="3">&nbsp;</td>
            </tr>
            <tr>
             <td colspan="3"><img width="600" height="60" alt="" src="nieuwsbrief_banner.gif</td>
            </tr>
            <tr>
             <td colspan="3">&nbsp;</td>
            </tr>
     </tbody>
   </table>
Run Code Online (Sandbox Code Playgroud)

我想删除所有出现的&nbsp;. 我能够替换字符串中的其他字符,但似乎无法替换&nbsp;为空字符串 ("")。我这样做了:

<cfset htmlcode = Replace(htmlcode, "&nbsp;", "", "all")>
Run Code Online (Sandbox Code Playgroud)

我也尝试更换nbsp;(没有 & 在开始)。结果全都&nbsp;变成了&amp;。然后我尝试了,<cfset htmlcode = ReplaceNoCase(htmlcode, "&amp;", "", "all")>但这并没有删除任何&amp;.

应该怎么办?

coldfusion replace

2
推荐指数
1
解决办法
2001
查看次数

标签 统计

coldfusion ×1

replace ×1