Op 4-4-2019 om 13:22 schreef K K Subbu:
On 04/04/19 4:46 PM, Roelof Wobben wrote:
Hello,
For a challenge of Exercism I need to check if some parenthes and
brackets are balanced.
so for example
() = true
([]) = true
but (]) is not true because the bracket has no opening bracket.
Now I wonder if I can premature end a #do: like this
collection do: [:element | (condition with element) ifFalse: [^false]]
Have you looked at anySatisfy:
#('the' 'quick' 'brown' 'fox') anySatisfy: [:s | s beginsWith: 'x' ]
Regards .. Subbu
yep, i also took a look at that one