【问题标题】:how to cut html content in a string in c#如何在c#中剪切字符串中的html内容
【发布时间】:2012-06-02 07:08:08
【问题描述】:

我有一个 HTML 内容,它是一个描述,我想使用 substring 函数剪切它。但它显示错误。

这是我的 HTML:

<span style="font-family: verdana; font-size: 13px; color: #000000;"><p><span style="font-  family: verdana; font-size: 13px; color: #000000;">There's no need to sacrifice performance with a small system.<br />  <br />  Experience the eco-friendly Small Form Factor (SFF) desktop platform  powered by the 2nd generation Intel&reg; Core&trade; vPro&trade; processor family.<br />  <br />  The EVO DQ67, coupled with the latest Intel&reg; Active Management  Technology (Intel&reg; AMT) 7.0, provides the unprecedented secured and  seamless PC remote management in SFF platform, featuring the latest  SuperSpeed USB 3.0, SATA 6 Gb/s technologies, and triple graphic port  options.<br />  <br />  </span><span style="font-family: verdana; font-size: 13px; color: #000000;">Select from our range of pre configured sytems or tell us what you want and we will build you your own individul    bespoke PC.</span></p>

【问题讨论】:

  • 你想剪它是什么意思?像将文本换行一样剪切?还是只显示一定数量的字符?
  • 不是一个真正的问题。描述您想要什么、您的目标是什么等,并请发布您遇到的错误、您尝试过的代码等。阅读How to Ask 页面了解更多信息。
  • 我只想显示一定数量的字符

标签: asp.net html


【解决方案1】:

真的需要更多关于你如何做到这一点的细节。尝试使用反斜杠转义字符串中的引号,以便 style="font-family: 变为 style=\"font-family:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-28
    • 2022-11-30
    • 1970-01-01
    • 2021-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多