Word替换并从RichTextBox-VB.Net中删除坏词 [英] Word replacement and removing bad words from a RichTextBox-VB.Net

查看:105
本文介绍了Word替换并从RichTextBox-VB.Net中删除坏词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何删除如下所示的单词:



我收到了一个不好的建议,一个不好的建议



我想从RichTextBox看起来像这样:



我收到了一个不好的建议



这些单词来自我的列表框。



如何删除已从ListBox复制/粘贴的单词?我的listBox分为两列,Bad words和Good words。坏词是那些看起来像这样的:一个糟糕的建议,而好的词是那样的:一个糟糕的建议。写作时有很多,你可以找到很多。

How do you remove words that appear like this:

I received aa bad advice a bad suggestion

I want it to look like this from the RichTextBox:

I received a bad suggestion

These words come from my Listbox.

How do I remove words that have been copy/pasted from the ListBox? My listBox is divided into two columns, the Bad words and Good words. The Bad words are those that look like this: a bad advice, while the Good words are those that look like this: a bad suggestion. There are many so when writing, you can find many.

推荐答案

如果我理解你的问题,你试图删除诅咒词(ex'sh * t',来自RichTextBox的'bi ^ ch'等)并用更友好的用户替换它们。我可以同意(在某一点上)本文中的其他一些评论,你应该真正尝试从编程经验中学到一些东西,而不是期望社区为你做的工作。要真正尝试和帮助指导你而不是判断你缺乏知识,这里有一些你应该真正看到的链接,以帮助你开始你当前的任务。



https://msdn.microsoft。 com / en-us / library / system.windows.forms.richtextbox.text(v = vs.110).aspx [ ^ ]



字符串替换 [ ^ ]



https://msdn.microsoft.com/en-us/library/ system.string.replace(v = vs.110).aspx [ ^ ]
If I understand your question correctly you are attempting to remove curse words (ex 'sh*t', 'bi^ch', etc.) from a RichTextBox and replace them with something more user friendly. I can agree (to a point) with some of the other comments in this post you should really try actually learning something from the programming experience and not expect the community to do your work for you. To actually attempt and help guide you instead of judge you for your lack of knowledge here are a few links you should really look at to get you started on your current task.

https://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.text(v=vs.110).aspx[^]

string replace[^]

https://msdn.microsoft.com/en-us/library/system.string.replace(v=vs.110).aspx[^]


尝试:
for each str as string in *your text*
 for each str2 as string in *your List*
if(str=str2) Then
yourtext.replace(str,"")
End if
Next
Next


这篇关于Word替换并从RichTextBox-VB.Net中删除坏词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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