Sample data.
"<td class=small bgcolor="E7E7E7">
Garth Was Here"
"<br><td class=small bgcolor="13B9C1">2006/03/08"
I'm looking for a two things.
1) A function to remove whitespaces. In the example data above not
only are there " " but there could be tabs and carriage returns.
2) I am also looking to strip off anything before the last ">" within
the string. I created a function that will do this for me, however for what
ever reason the InStrRev always returns 0. What I'm I doing wrong or how can
I fix this?
Public Function Clean_str(ByVal Str_in As String) As String
Dim Search As String
Dim Temp As String
Dim Temp2 As String
Dim start As Integer
Dim L As Integer
Search = "</td>"
L = Len(Search)
start = InStr(Str_in, Search, CompareMethod.Text)
Temp2 = Mid(Str_in, 1, start - 1)
Temp = Mid(Str_in, start + L)
'Find "> which is before the Date"
Search = "<br>"
start = InStr(Temp2, Search, CompareMethod.Text)
Temp2 = Mid(Temp2, 1, start - 1)
Search = ">"
start = InStrRev(Temp2, Search, CompareMethod.Text)
L = Len(Search)
Temp2 = Mid(Temp2, start + L)
Temp2 = Trim(Temp2)
Return Temp2
End Function