<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>hi Bruce,</p>
<p>I've omitted the "Replace" :)<br>
</p>
<p>Olivier<br>
</p>
<div class="moz-cite-prefix">Le 12/01/2021 Ã 18:35, Bruce Steers a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CABuQYCBQ-uf9=Cq8a2JW+DaadFoKvW6+GeGzpquWYOqoLPdHiQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">',' is the
default delimiter for Split() if no separator is given.<br>
</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">Using Replace
("Test - test2 - test3 test4", " - ",",")Â will replace all '
- ' occurrence for ','<br>
</div>
<div class="gmail_default" style="font-size:small">then Split()
without using a separator splits at every ','</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">If you wanted
to use your own delimiter char like '|' use...</div>
<div class="gmail_default" style="font-size:small">Split(Replace
("Test - test2 - test3 test4", " - ","|"), "|")</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
<div class="gmail_default" style="font-size:small">BruceS<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, 12 Jan 2021 at 17:25,
Olivier Coquet <<a href="mailto:ocoquet@3d-phenomen.fr"
moz-do-not-send="true">ocoquet@3d-phenomen.fr</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">thank's
Fabien, but I don't understand what is the "," ???<br>
<br>
<br>
Olivier<br>
<br>
Le 12/01/2021 à 18:13, Fabien Bodard a écrit :<br>
> Well<br>
><br>
> split(Replace ("Test - test2 - test3 test4", " - ",","))<br>
><br>
> will do the job<br>
><br>
> Le mar. 12 janv. 2021 Ã 15:26, ocoquet <<a
href="mailto:ocoquet@3d-phenomen.fr" target="_blank"
moz-do-not-send="true">ocoquet@3d-phenomen.fr</a>> a
écrit :<br>
>> Thank's Charlie, i'll try this....<br>
>><br>
>> Regards<br>
>><br>
>> Olivier<br>
>><br>
>><br>
>> Envoyé depuis mon appareil Galaxy<br>
>><br>
>><br>
>> -------- Message d'origine --------<br>
>> De : Charlie Ogier <<a
href="mailto:charlie@cogier.com" target="_blank"
moz-do-not-send="true">charlie@cogier.com</a>><br>
>> Date : 12/01/2021 14:47 (GMT+01:00)<br>
>> À : <a href="mailto:user@lists.gambas-basic.org"
target="_blank" moz-do-not-send="true">user@lists.gambas-basic.org</a><br>
>> Objet : Re: [Gambas-user] Split Function ???<br>
>><br>
>> Hi Olivier,<br>
>><br>
>> Try this: -<br>
>><br>
>> '****************************<br>
>> Public Sub Form_Open()<br>
>><br>
>>Â Â Dim s As String = "Test - test2 - test3 test4"<br>
>>Â Â Dim sArray As String[] = Split(s, "-") 'NOT " - "<br>
>>Â Â Dim iLoop As Integer<br>
>><br>
>>Â Â For iLoop = 0 To sArray.Max<br>
>>Â Â Â Print Trim(sArray[iLoop])<br>
>>Â Â Next<br>
>><br>
>> End<br>
>> '****************************<br>
>><br>
>> Charlie<br>
>><br>
>> On 12/01/2021 13:03, Olivier Coquet wrote:<br>
>><br>
>> Hi all,<br>
>><br>
>> I have a problem with Split function.<br>
>><br>
>> If I have a string like this:<br>
>><br>
>> "Test - test2 - test3 test4"<br>
>><br>
>> and I split with " - " separation string, I obtain<br>
>><br>
>> "Test" "test2" "test3" "test4"<br>
>><br>
>> and I want:<br>
>><br>
>> "Test" "test2" "test3 test4"<br>
>><br>
>> How can I make this ?<br>
>><br>
>><br>
>> regards<br>
>><br>
>> Olivier<br>
>><br>
>><br>
>> ----[ <a
href="http://gambaswiki.org/wiki/doc/netiquette"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://gambaswiki.org/wiki/doc/netiquette</a>
]----<br>
>><br>
>><br>
>><br>
>> ----[ <a
href="http://gambaswiki.org/wiki/doc/netiquette"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://gambaswiki.org/wiki/doc/netiquette</a>
]----<br>
><br>
><br>
<br>
----[ <a href="http://gambaswiki.org/wiki/doc/netiquette"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://gambaswiki.org/wiki/doc/netiquette</a>
]----<br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">
----[ <a class="moz-txt-link-freetext" href="http://gambaswiki.org/wiki/doc/netiquette">http://gambaswiki.org/wiki/doc/netiquette</a> ]----
</pre>
</blockquote>
</body>
</html>