代码拉取完成,页面将自动刷新
同步操作将从 小墨/力扣题库(完整版) 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<p><strong>HTML entity parser</strong> is the parser that takes HTML code as input and replace all the entities of the special characters by the characters itself.</p>
<p>The special characters and their entities for HTML are:</p>
<ul>
<li><strong>Quotation Mark:</strong> the entity is <code>&quot;</code> and symbol character is <code>"</code>.</li>
<li><strong>Single Quote Mark:</strong> the entity is <code>&apos;</code> and symbol character is <code>'</code>.</li>
<li><strong>Ampersand:</strong> the entity is <code>&amp;</code> and symbol character is <code>&</code>.</li>
<li><strong>Greater Than Sign:</strong> the entity is <code>&gt;</code> and symbol character is <code>></code>.</li>
<li><strong>Less Than Sign:</strong> the entity is <code>&lt;</code> and symbol character is <code><</code>.</li>
<li><strong>Slash:</strong> the entity is <code>&frasl;</code> and symbol character is <code>/</code>.</li>
</ul>
<p>Given the input <code>text</code> string to the HTML parser, you have to implement the entity parser.</p>
<p>Return <em>the text after replacing the entities by the special characters</em>.</p>
<p> </p>
<p><strong>Example 1:</strong></p>
<pre>
<strong>Input:</strong> text = "&amp; is an HTML entity but &ambassador; is not."
<strong>Output:</strong> "& is an HTML entity but &ambassador; is not."
<strong>Explanation:</strong> The parser will replace the &amp; entity by &
</pre>
<p><strong>Example 2:</strong></p>
<pre>
<strong>Input:</strong> text = "and I quote: &quot;...&quot;"
<strong>Output:</strong> "and I quote: \"...\""
</pre>
<p> </p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>1 <= text.length <= 10<sup>5</sup></code></li>
<li>The string may contain any possible characters out of all the 256 ASCII characters.</li>
</ul>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。