Differences between select:, reject:, and detect:
P | N


| aString |

aString := 'Now is the time for all good men to come to the aid of their blah blah blah'.

aString select: [:each | each isVowel].

" --> 'oieieoaooeooeoeaioeiaaa' "


aString reject: [:gobbledy | gobbledy isVowel].

" --> 'Nw s th tm fr ll gd mn t cm t th d f thr blh blh blh'"


aString detect: [:gobbledy | gobbledy isVowel].

" --> $o"


Previous | Next


Last modified at 7/24/97; 1:43:07 PM
Other Links of Interest
College of Computing | EduTech Institute | GVU Center
Mark Guzdial | Papers | CS 2390 Spring '97 Home Page | STABLE | MMC-CaMILE

Slide Master