Login  Register

Re: how can I divide a string in parts of 5

Posted by jtuchel on Sep 10, 2020; 12:04pm
URL: https://forum.world.st/how-can-I-divide-a-string-in-parts-of-5-tp5121570p5121571.html

Look at implementors and senders of #to:by:do: as a start. You can
iterate over a Collection (String is a Collection) making bigger steps.
Or look around for ReadStream and methods like #atEnd and #next:

HTH

Joachim



Am 10.09.20 um 13:48 schrieb Roelof Wobben via Pharo-users:

> Hello,
>
> For another challenge of exercism I have to divide a string in parts
> of max 5 characters.
> so for example abcdefg willl be "abcde fg"
>
> Any hints how I can achieve this ?
>
> Roelof
>
>
>

--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:[hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1