Re: [Gambas-user] Split: misleading Wiki

2017-05-23 Thread Matti
Very good explanation, thank you. Am 22.05.2017 um 23:33 schrieb d4t4f...@gmail.com: > Matti > > Your string has 3 substrings when split with SPLIT (STRING, "#"): > > Index 0: "Hello" > Index 1: "" > Index 2: "12345" > > It is documented that separators are single characters, not strings; you can

Re: [Gambas-user] Split: misleading Wiki

2017-05-23 Thread Gianluigi
A variant of the previous suggestions, to ignored (5) voids :-) Public Sub Main() Dim ss As String[] Dim s As String ss = Split("hello#12345", "#") For Each s In ss If Not IsNull(s) Then Print s; Next End Regards Gianluigi 2017-05-23 8:38 GMT+02:00 Fabien Bodard : > A=Split

Re: [Gambas-user] Split: misleading Wiki

2017-05-22 Thread Fabien Bodard
A=Split (replace ("##yyy##1234","##",chr (27)),chr (27)) Or do not use double characters as separator . Le 22 mai 2017 23:35, a écrit : > Matti > > Your string has 3 substrings when split with SPLIT (STRING, "#"): > > Index 0: "Hello" > Index 1: "" > Index 2: "12345" > > It is documented

Re: [Gambas-user] Split: misleading Wiki

2017-05-22 Thread d4t4full
Matti Your string has 3 substrings when split with SPLIT (STRING, "#"): Index 0: "Hello" Index 1: "" Index 2: "12345" It is documented that separators are single characters, not strings; you can specify a string because any of its individual characters may be used as separator. If you also sp

Re: [Gambas-user] Split: misleading Wiki

2017-05-22 Thread Matti
Ok, thank you, Tobi. I'll have to start thinking again (but not tonight anymore). Matti Am 22.05.2017 um 22:17 schrieb Tobias Boege: > On Mon, 22 May 2017, Matti wrote: >> If I have a string sStr="hello##12345" and want to split it: >> >> Dim aSplit as String[] >> aSplit = Split(sStr, "##") >> Pri

Re: [Gambas-user] Split: misleading Wiki

2017-05-22 Thread Tobias Boege
On Mon, 22 May 2017, Matti wrote: > If I have a string sStr="hello##12345" and want to split it: > > Dim aSplit as String[] > aSplit = Split(sStr, "##") > Print aSplit[0], aSplit[1] > > Returns always only "hello". Maybe "12345" is excluded because being an > integer? > It is not an integer in