Shorten string

Bert Freudenberg bert at freudenbergs.de
Thu Mar 1 16:23:28 UTC 2007


'The general-purpose Squeak developers list' contractTo: 20

- Bert -

On Mar 1, 2007, at 16:44 , Ron Teitelbaum wrote:

> Sorry saw a typo.  Here it is again :)
>
> 'vowels' copyWithoutAll: 'aeiou' copy.
>
> 'vowels' select: [:aCharacter | aCharacter isVowel not].
>
> aStream := 'vowels' copy readStream.
> result := WriteStream on: String new.
> [aStream atEnd] whileFalse: [
> 	nextCharacter := aStream next.
> 	nextCharacter isVowel
> 	ifFalse: [
> 		result nextPut: nextCharacter.
> 	]
> ].
> ^result contents
>
> Ron Teitelbaum
>
>> From: Benoit St-Jean
>> Sent: Thursday, March 01, 2007 9:58 AM
>>
>> Try this:
>>
>> 'vowels' reject: [:e | 'aeiouy' includes: e]
>>
>>
>> -----------------
>> Benoit St-Jean
>> Yahoo! Messenger: bstjean
>> Blog: lamneth.wordpress.com
>> A standpoint is an intellectual horizon of radius zero.
>> (Albert Einstein)
>>
>> ----- Original Message ----
>> From: Mathieu Suen <mathk.sue at gmail.com>
>> To: The general-purpose Squeak developers list <squeak-
>> dev at lists.squeakfoundation.org>
>> Sent: Thursday, March 1, 2007 9:51:48 AM
>> Subject: Shorten string
>>
>> Hi,
>>
>> Is they a way to shorten string in a way that i still understandable
>> but more compacte?
>> For exemple something  that remove all the vowel.







More information about the Squeak-dev mailing list