Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

1 solution

VB
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


make sure there are spacechar after dot
 
Share this answer
 
Comments
jai_mca 4-Mar-13 4:07am    
yes..with dot spacechar exist.
jai_mca 4-Mar-13 4:09am    
i found the solution..we need to mention the string.

str = para.Split(New String() {". "}, System.StringSplitOptions.None)
Just eg 4-Mar-13 5:29am    
nice

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900