FindTokens: in Pharo compared to Dolphin Smalltalk

I want to split String in Pharo 4. My input

'a %% b %% c %%% d %% e %% f' 

and i want to get

#('a %% b %% c' 'd %% e %% f')

thus, the delimiter is "%%%"

The Dolphin 7 works well:

'a %% b %% c %%% d %% e %% f' subStrings: ' %%% '
#('a %% b %% c' 'd %% e %% f')

But in Pharo 4 it seems broken:

'a %% b %% c %%% d %% e %% f' subStrings: ' %%% '
"#('a' 'b' 'c' 'd' 'e' 'f')"

Is there a way to get dolphin behavior in Faro?

+4
source share
1 answer

Try

'a %% b %% c %%% d %% e %% f' splitOn: ' %%% '

He also works with

'a %% b %% c %%% d %% e %% f %%% g %% h %% i' splitOn: ' %%% '
+3
source

All Articles