[squeak-dev] self subStrings:'||'

Levente Uzonyi leves at caesar.elte.hu
Thu Oct 24 21:20:14 UTC 2019


On Thu, 24 Oct 2019, gettimothy via Squeak-dev wrote:

> Hi all.
>
>       ' Middle-left-cell || style="width: 14em;" | Middle-center-cell || Middle-right-cell' self subStrings:'|'
> ' Middle-left-cell || style="width: 14em;" | Middle-center-cell || Middle-right-cell' self subStrings:'||'
> 
> inspect both, they are identical.
> 
> Is this expected behavior?
> 
> Looking at the method:
>       char := sourceStream next.
> 
> 
> is the "problem" in that a match is had for the single pipe character.
> 
> Is there a better way to split that string along double pipes '||'  ?

You almost answered your own question:

'foo|bar||baz' splitBy: '||'.


Levente

> 
> thank you in advance.
> 
> 
> 
> 
> 
>


More information about the Squeak-dev mailing list