Results 1 to 2 of 2

Thread: [VB6] Fast GetStringBetween

  1. #1
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    12,606
    Userbars
    123
    Thanks
    5,177
    Thanked
    27,964/5,877
    DL/UL
    23/36
    Mentioned
    3,615 times
    Time Online
    493d 16h 18m
    Avg. Time Online
    3h 20m

    [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: ""(you need an account to see links)"">", "")

    PS: If you have to use quotation marks in your code, put two like how I did. Otherwise it not work.
    (you need an account to see links)
    (you need an account to see links)(you need an account to see links)


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


  2. #2
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,234
    Userbars
    8
    Thanks
    767
    Thanked
    1,457/676
    DL/UL
    97/0
    Mentioned
    509 times
    Time Online
    24d 10h 31m
    Avg. Time Online
    9m
    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
  •