如何根据searcg的单词从RTB获得句子? [英] how to get sentence from RTB based on a word by searcg?

查看:72
本文介绍了如何根据searcg的单词从RTB获得句子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



早上好..



i开发窗口应用程序来编辑pdf内容。现在我有一点疑问。在我的应用程序中,我有一个文本框用于获取关键字。另一个richtextbox用于获取段落内容。我使用了下面的代码。但我不会基于

点分割句子空间(例如:。)。它只是基于点分割(例如:。)。现在问题是句子中出现点(如www.code.com),它只是将句子分开。 br $> b $ b



我们可以使用mid函数或Instrrev函数吗?

如果可能的话我们如何使用?br />
请让我知道.........



Dear friends,

Good morning..

i am developing window application to edit pdf content.now i have small doubt.in my application i have one textbox for getting keyword.another richtextbox for getting paragraph content.i have used the below code.but i doesnot split the sentence based on
dot and space(Eg:". ").it just split based on dot only(Eg:".").now the problem was where ever dot occurs in sentence(like www.code.com),it just split the sentence.


so can we use mid function or Instrrev function?
if possible how can we use?
please let me know that.........

str = para.Split(". ")

            For i As Integer = 0 To UBound(str)
                      If str(i).Contains(LCase(word)) Or str(i).Contains(UCase(word)) Then

                              RTBabstract.Text = ""
                              RTBabstract.Text = str(i) & "."
                              Trim(RTBabstract.Text)

                          End If

推荐答案

Dim str() as string
str() = replace(para,". ","|").split("|")
For i As Integer = 0 To UBound(str)
    If (uCase(str(i)).Contains(uCase(word)) Then
       RTBabstract.Text = Trim(str(i) & ".")
    End If





确保点后面有spacechar



make sure there are spacechar after dot


这篇关于如何根据searcg的单词从RTB获得句子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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