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

Christof Thalhofer chrisml at deganius.de
Tue Nov 10 12:28:43 CET 2020


Am 10.11.20 um 11:56 schrieb Rolf-Werner Eilert:

> Your race was a bit about speed. Using Replace() over and over might be 
> the drawback here, as it will certainly use a loop internally doing more 
> or less the same as my function does. The same applies to regex, and 
> even heavier.
> 
> But I agree, the other solutions are more elegant than mine :)

Currently Brian G holds the price for max speed.

And yours needs about 1600 ms for one single(!) run* of the bobiba.txt
on my computer. I think it's one of the slowest. ;-)

The other ones run the text 500 times in about 2.5 seconds. Your code
would need about 13 minutes for the same task.

Alles Gute

Christof Thalhofer

* picture of this single run attached.

-- 
Dies ist keine Signatur
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rolf.png
Type: image/png
Size: 41975 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201110/c5fce241/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20201110/c5fce241/attachment-0001.sig>


More information about the User mailing list