如何在C#中的特定单词出现之前添加文本? [英] How do I add a text before a particular word occurrence in C#?
问题描述
您好,
我想比较两个文件(在RichTextBoxes中导入的数据)。并且我希望在每次出现特定单词后添加一个特定的句子。
所以说假设,我必须找到年代表这个词。因此,它将首先比较两个文件中是否存在该单词。如果是,那么它将添加<这是单词>,上面写着单词的一行。
这将一直持续到结束文件。
请帮助。
问候
Aman Chaurasia
我尝试过:
我已经在RichTextBoxes中导入了2个文件现在必须处理上面提到的事件。
Hello,
I want to compare two files (data imported in RichTextBoxes). And I want to add a particular sentence after every occurrence of a particular word.
So say suppose, I have to find the word chronology. SO it will first compare whether the word is there or not in both the files. If yes then it will add "<This is the word>", a line above where the word is written.
This will go on till the end of the file.
Please help.
Regards
Aman Chaurasia
What I have tried:
I have already imported 2 files in RichTextBoxes and now have to process the above mentioned event.
推荐答案
你已经在如何在C#中创建一个查看器? [ ^ ];请不要重新发布。
You have already posted this question at How do I create a viewer in C#?[^]; please do not repost.
这篇关于如何在C#中的特定单词出现之前添加文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!