如何在RTF中查找上标 [英] how to find superscripts in RTF

查看:199
本文介绍了如何在RTF中查找上标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单测试表明RichtextBox. SelectionCharOffset 属性对应于"\ upn"属性. RTF标签. (例如\ up3 \ up0对).我需要检查另一种由RTF标签"\ super"定义的上标.和"\ nosupersub".这些是 当将文本从网页复制/粘贴到RichTextBox时,HTML上标(< sup></sup>)会转换为的标签.很遗憾, SelectionCharOffset 无法识别它们.

Simple tests show that RichtextBox.SelectionCharOffset property corresponds to "\upn" RTF tag. (e.g. \up3 \up0 pair). I need to check for another kind of superscripts that are defined by RTF tags "\super" and "\nosupersub". These are the tags that HTML superscripts (<sup> </sup>) are translated to when copying/pasting texts from web pages to RichTextBox. Unfortunately, SelectionCharOffset does not recognize them.

还有其他方法可以在RichTextBox中查找上标文本吗?

Is there any other way to find superscripted text within RichTextBox?

谢谢.

亚历克斯

 

推荐答案

您可能希望研究正则表达式来解决此问题.
You might want to look into Regular Expressions to solve this.


这篇关于如何在RTF中查找上标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆