split (or splitOn) are working on characters, but also on regex and  blocks!

'Complementary metal-oxide semiconductor' splitOn: '-| ' asRegex.

'Complementary metal-oxide semiconductor' splitOn: [:c | c isSpaceSeparator
or:[ c = $-] ].





Am Sa., 24. Nov. 2018 um 22:29 Uhr schrieb Roelof Wobben <r.wob...@home.nl>:

> hmm,  I can split on the space or on the -  but not on both
>
> 'Complementary metal-oxide semiconductor' splitOn: '[- ]'
>
> this does nothing
>
> 'Complementary metal-oxide semiconductor' splitOn: '- '
>
> does work and
>
> 'Complementary metal-oxide semiconductor' splitOn: '  '
>
> does work
>
>
>
> Op 24-11-2018 om 22:19 schreef Roelof Wobben:
>
> thanks,
>
> this one looks very promosing :    self assert: ('foobar' splitOn:
> '[aeiou]+'
>
> Roelof
>
>
>
> Op 24-11-2018 om 22:07 schreef Nicolai Hess:
>
> What have you tried so far?
> There is a split method in pharo, with examples :)
>
> Am Sa., 24. Nov. 2018 um 21:49 Uhr schrieb Roelof Wobben <r.wob...@home.nl
> >:
>
>> Hello,
>>
>> For a acronym maker challenge on exercism.io I have to make acronyms.
>> But I see I have to split the parts on space and when it's a word with a
>> - then I have to split on that,
>>
>> Any hint how I can do that ?
>>
>> Roelof
>>
>>
>
>

Reply via email to