Results 1 to 2 of 2

Thread: [VB6] Fast GetStringBetween

  1. #1
    Saiyan Race j03's Avatar
    Join Date
    Dec 2011
    Posts
    12,283
    Userbars
    115
    Thanks
    4,830
    Thanked 26,090 Times in 5,681 Posts
    Downloads
    23
    Uploads
    36
    Mentioned
    3503 Post(s)
    Time Online
    467 d 19 h 10 m
    Avg. Time Online
    3 h 21 m
    Rep Power
    25

    [VB6] Fast GetStringBetween

    Fastest? Well I'd like to say it is as some people claim it to be, but anything is possible

    Here it is:

    Code:
    Public Function GetStringBetween(Main As String, start As String, Finish As String, Optional Index As Long = 1) As String
    On Error Resume Next
        GetStringBetween = Split(Split(Main, start, Index + 1)(Index), Finish, 2)(0)
    End Function
    An example of using this to grab NP on hand would be:

    lblNP.Caption = GetStringBetween(HTML, "NP: ""[Only registered and activated users can see links. ]"">", "")

    PS: If you have to use quotation marks in your code, put two like how I did. Otherwise it not work.
    [Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ][Only registered and activated users can see links. ]


    [02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.


  2. #2
    Zachafer's Avatar
    Join Date
    Dec 2011
    Posts
    1,217
    Userbars
    6
    Thanks
    762
    Thanked 1,445 Times in 673 Posts
    Downloads
    97
    Uploads
    0
    Mentioned
    508 Post(s)
    Time Online
    24 d 8 h 8 m
    Avg. Time Online
    10 m
    Rep Power
    18
    Joe I'm pretty sure using Mid$ (even better MidB$) is faster than using Split, especially because the Delimiter parameter is a variant and variants are the slowest data types.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •