[Gambas-user] trimming extra spaces from within a string.

Bruce Steers bsteers4 at gmail.com
Tue Nov 10 00:07:41 CET 2020


On Mon, 9 Nov 2020 at 22:54, Fabien Bodard <gambas.fr at gmail.com> wrote:

> And .. sorry I'm on phone but
>
> Just walk on the string if not space add to new string ...if first space
> too... jump to the next not space letter ...etc ?
>
> Is this not more faster than using a recursive call to replace ?
>
> The 3 ms gain from benoit can come from the fact he not use trim.
>

Aah yes i see, thank you  (me wishful thinking lol)
I went for Benoits method , way better than mine :)



>
>
>> On Tue, Nov 10, 2020 at 12:43 AM Jussi Lahtinen <jussi.lahtinen at gmail.com>
>> wrote:
>>
>>> Your way is run only twice, the other ways are run 500 times. Thus it
>>> seems your way is faster.
>>> You already have this program, it is the IDE. See profiler.
>>>
>>
Fantastic, now that's a handy tool I've only just discovered :)

Thanks Fabien

BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201109/09bce138/attachment.htm>


More information about the User mailing list