j03
12-28-2011, 11:20 AM
Fastest? Well I'd like to say it is as some people claim it to be, but anything is possible
Here it is:
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: <a id='npanchor' href=""/objects.phtml?type=inventory ([Only registered and activated users can see links])"">", "</a>")
PS: If you have to use quotation marks in your code, put two like how I did. Otherwise it not work.
Here it is:
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: <a id='npanchor' href=""/objects.phtml?type=inventory ([Only registered and activated users can see links])"">", "</a>")
PS: If you have to use quotation marks in your code, put two like how I did. Otherwise it not work.