Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27349

VS 2010 Need help with string

$
0
0
Hey vbforums,

Let's say I have this text file:


Code:

[text1]
line 1
line 2
[/text1]


[text1]
line 3
line 4
[/text1]

How can I get the text between from both [text1] and [/text1]

Coded this function, but it'll get only the text from the first text1 and /text1:
Code:

    Function StrSplit(ByVal String1 As String, ByVal first As String, ByVal second As String) As String
        Dim firststring As String() = Split(String1, first)
        Dim secondstring As String() = Split(firststring(1), second)
        Dim finalstring As String = secondstring(0)
        Return finalstring
    End Function


Viewing all articles
Browse latest Browse all 27349

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>