[Gambas-devel] gb3 Split() problem
Benoît Minisini
gambas at ...1...
Mon Jan 4 11:25:23 CET 2010
> Gb3 does not correctly split when the separator is a "\r\n" combination:
>
> Dim aText As String
> Dim bText As String
> Dim aLines As String[]
> Dim bLines As String[]
>
> aText = File.Load("Text1")
> bText = Replace(aText, "\n", "\r\n")
>
> aLines = Split(aText, "\n")
> bLines = Split(bText, "\r\n")
>
> The gb3 documentation states, "Separators is a list of sperators
> characters",
That means that both "\r" and "\n" are separator characters. Split() can only
deal with one character separators.
To split between "\r\n", you must write your own function.
Regards,
--
Benoît Minisini
More information about the Devel
mailing list