I want to split a String in Pharo 4. My input is
'a %% b %% c %%% d %% e %% f'
and I want to get
#('a %% b %% c' 'd %% e %% f')
因此分隔符是 ' %%% '
在 Dolphin 7 中它的使用效果很好:
'a %% b %% c %%% d %% e %% f' subStrings: ' %%% '
#('a %% b %% c' 'd %% e %% f')
但是在Pharo 4中,似乎出现了故障:
'a %% b %% c %%% d %% e %% f' subStrings: ' %%% '
"#('a' 'b' 'c' 'd' 'e' 'f')"
有没有办法在Pharo中实现Dolphin的行为?
'a %% b %% c %%% d %% e %% f' readStream upToAll: ' %%% '
? - Leandro Caniglia'a %% b %% c %%% d %% e %% f %%% g %% h %% i' readStream upToAll: ' %%% '
。 - user1000565[stream atEnd] whileFalse: [result add: (stream upToAll: ' %%%% ')]
的方式收集upToAll:
的结果。 - Leandro Caniglia