# [Gambas-user] Split Function ???

Olivier Coquet ocoquet at 3d-phenomen.fr
Tue Jan 12 18:35:43 CET 2021

```Hi Fabien,

:) :) :) :)

Yes but what is the function of "," in split arguments ?

Olivier

Le 12/01/2021 à 18:28, Fabien Bodard a écrit :
> Le mar. 12 janv. 2021 à 18:25, Olivier Coquet <ocoquet at 3d-phenomen.fr> a écrit :
>> thank's Fabien, but I don't understand what is the "," ???
> .... a comma ? :-D
>>
>> Olivier
>>
>> Le 12/01/2021 à 18:13, Fabien Bodard a écrit :
>>> Well
>>>
>>> split(Replace ("Test - test2 - test3 test4", " - ",","))
>>>
>>> will do the job
>>>
>>> Le mar. 12 janv. 2021 à 15:26, ocoquet <ocoquet at 3d-phenomen.fr> a écrit :
>>>> Thank's Charlie, i'll try this....
>>>>
>>>> Regards
>>>>
>>>> Olivier
>>>>
>>>>
>>>> Envoyé depuis mon appareil Galaxy
>>>>
>>>>
>>>> -------- Message d'origine --------
>>>> De : Charlie Ogier <charlie at cogier.com>
>>>> Date : 12/01/2021 14:47 (GMT+01:00)
>>>> À : user at lists.gambas-basic.org
>>>> Objet : Re: [Gambas-user] Split Function ???
>>>>
>>>> Hi Olivier,
>>>>
>>>> Try this: -
>>>>
>>>> '****************************
>>>> Public Sub Form_Open()
>>>>
>>>>     Dim s As String = "Test - test2 - test3 test4"
>>>>     Dim sArray As String[] = Split(s, "-") 'NOT " - "
>>>>     Dim iLoop As Integer
>>>>
>>>>     For iLoop = 0 To sArray.Max
>>>>       Print Trim(sArray[iLoop])
>>>>     Next
>>>>
>>>> End
>>>> '****************************
>>>>
>>>> Charlie
>>>>
>>>> On 12/01/2021 13:03, Olivier Coquet wrote:
>>>>
>>>> Hi all,
>>>>
>>>> I have a problem with Split function.
>>>>
>>>> If I have a string like this:
>>>>
>>>> "Test - test2 - test3 test4"
>>>>
>>>> and I split with " - " separation string, I obtain
>>>>
>>>> "Test" "test2" "test3" "test4"
>>>>
>>>> and I want:
>>>>
>>>> "Test" "test2" "test3 test4"
>>>>
>>>> How can I make this ?
>>>>
>>>>
>>>> regards
>>>>
>>>> Olivier
>>>>
>>>>
>>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>>
>>>>
>>>>
>>>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>>>
>> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
>
```