VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Strip HTML

by DoWnLoHo (14 Submissions)
Category: VB function enhancement
Compatability: Visual Basic 3.0
Difficulty: Unknown Difficulty
Date Added: Wed 3rd February 2021
Rating: (5 Votes)

Strip HTML from a string with this function. That basically explains it's all!!

Rate Strip HTML

Public Function StripHTML(sHTML As String) As String
Dim sTemp As String, lSpot1 As Long, lSpot2 As Long, lSpot3 As Long
sTemp$ = sHTML$
Do
 lSpot1& = InStr(lSpot3& + 1, sTemp$, "<")
 lSpot2& = InStr(lSpot1& + 1, sTemp$, ">")
 
  If lSpot1& = lSpot3& Or lSpot1& < 1 Then Exit Do
  If lSpot2& < lSpot1& Then lSpot2& = lSpot1& + 1
  
 sTemp$ = Left$(sTemp$, lSpot1& - 1) + Right$(sTemp$, Len(sTemp$) - lSpot2&)
 lSpot3& = lSpot1& - 1
Loop
StripHTML$ = sTemp$
End Function

Download this snippet    Add to My Saved Code

Strip HTML Comments

No comments have been posted about Strip HTML. Why not be the first to post a comment about Strip HTML.

Post your comment

Subject:
Message:
0/1000 characters