【发布时间】:2016-04-17 16:27:56
【问题描述】:
由于我无法更改程序,因此我在此问题上没有任何其他选择,因此我需要一种以编程方式删除文本行中存在的百分号垃圾格式的方法:
查询将返回如下字符串:
'%3CSPAN style='FONT-SIZE: 12pt; FONT-FAMILY: %22Times New Roman%22,%22serif%22; mso-fareast-font-family: %22Times New Roman%22; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA'%3E%3CFONT color=#000000%3E3/20/18: Mrs. McDoogal completed a medical assessment with Dr. John Zoidberg, MD, at Futurama on 4/6/15 and he completed a new substance assessment on 4/14/18.%3C/FONT%3E%3CSPAN style=%22mso-spacerun: yes%22%3E%3CFONT color=#000000%3E %3C/FONT%3E%3C/SPAN%3E%3CFONT color=#000000%3EMrs. McDoogal is diagnosed with Foobar I diagnosis of Groovy Mind, Foo; Cartoon Dependence; and Fiddling Disorder. %3C/FONT%3E%3CSPAN style=%22mso-spacerun: yes%22%3E%3CFONT color=#000000%3E %3C/FONT%3E%3C/SPAN%3E%3CFONT color=#000000%3EMr. McDoogal is prescribed DDT 30 mg. and LSD 150 mg ABC.%3C/FONT%3E%3CSPAN style=%22mso-spacerun: yes%22%3E%3CFONT color=#000000%3E %3C/FONT%3E%3C/SPAN%3E%3CFONT color=#000000%3EMr. McDoogal will be enrolled in the day treatment program at Futurama.%3C/FONT%3E%3CSPAN style=%22mso-spacerun: yes%22%3E%3CFONT color=#000000%3E %3C/FONT%3E%3C/SPAN%3E%3C/SPAN%3E'
我想去掉这样的东西:
.%3C/FONT%3E%3CSPAN style=%22mso-spacerun: yes%22%3E%3CFONT color=#000000%3E %3C/FONT%3E%3C/SPAN%3E%3C/SPAN%3E
我想去掉的东西叫什么名字?
【问题讨论】:
-
这不是“垃圾”,它可能是 HTML 或 URL 编码的字符值。
-
这看起来像一个 URL 编码的字符串。签出:stackoverflow.com/questions/3778165/…
-
mso 标签表示它是直接从 Microsoft Office 产品复制的,因此正确地对其进行 URL 解码是不够的,但您可能还需要使用 RegEx 正确执行清理功能跨度>
-
戴维,链接失效了。
标签: c#