|
-
Jul 5th, 2021, 11:53 AM
#1
Thread Starter
Addicted Member
[RESOLVED] vb6; parsing text to list listbox
i solved it my self
in case anyone need this here is code:
List1.Clear
Dim sInput As String
sInput = Text1.Text
Dim Item
For Each Item In Split(sInput, "</option>")
Item = Mid(Item, InStrRev(Item, ">") + 1)
If Len(Item) Then List1.AddItem Item
Next
Last edited by geekmaro; Jul 5th, 2021 at 04:09 PM.
-
Jul 5th, 2021, 05:07 PM
#2
Re: [RESOLVED] vb6; parsing text to list listbox
Sam I am (as well as Confused at times).
-
Jul 5th, 2021, 07:21 PM
#3
Re: [RESOLVED] vb6; parsing text to list listbox
Smells like an accident waiting to happen.
HTML is very loose and floppy. For example:
</option >
is perfectly legal, as is:
</optionCRLF> and </optionTAB> and others.
When he runs into one of those the wheels will come off. Data corruption, lost data, etc. You can never trust HTML as an input source.
Very large and messy programs (browsers) have to deal with this, as do large and messy utilities that make attempts to clean up the dog's breakfast known as HTML. "HTML Tidy" is one of the older ones.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|