[Gambas-user] Parsing HTML with Split(). Is this a BUG??

Benoit Minisini gambas at ...1...
Wed Nov 5 00:04:28 CET 2008


On mardi 4 novembre 2008, birchy wrote:
> Hi, i'm new to Gambas following a full migration from Windows XP/VB6 to
> Ubuntu 8.04/Gambas. I have used VB6 for around 6 years and am really loving
> Gambas, however i have a small problem. I am working on a web app that
> downloads the HTML source of a web page and then parses various information
> from it. Correct me if i am wrong, but Gambas does not have an HTML parsing
> library, so i am working on my own function. The problem i have is with the
> Split() function:
> ---------------------------------------------------------------------------
> DIM sa AS String[]
> sa = Split("<td>this is a</td> split test ", "</td>")
> ---------------------------------------------------------------------------
> This produces an array of 13 elements due to it splitting on each SINGLE
> character rather than the specified string. I expected it to produce an
> array of 2 strings: "<td>this is a" and " split test ".
>
> The same question remains unanswered on
> http://www.nabble.com/How-to-split-a-string--to9047840.html#a9047840 THIS
> thread. At this stage, i am assuming that i'll need to write my own split
> function using the InStr(), Mid$(), Left$(), Right$() functions??

Yep. Split() is not powerful enough for that.

-- 
Benoit Minisini




More information about the User mailing list