Because of cultural differences, I'm not sure
by "filter out" whether you mean include or
exclude
but when filtering any collection type,
#select: #detect and #reject: are you main go to
messages.
If you inspect your dictionary and on the
meta tab filter for ...*select*...��
you'll find #associationsSelect:
which works like this...
d := Dictionary newFromPairs: #( 1 2 3 4 5
6 ).
d associationsSelect: [ :asn | (asn key =
1) and: (asn value = 2) ]
d inspect. ==> Dictionary [1 item]
(1->2 )
I notice there is not a similar
#associationsReject:��
so if needed you could add your own
considering...
d := Dictionary newFromPairs: #( 1 2 3 4 5
6 ).
d associations select: [ :asn | (asn key =
1) and: (asn value = 2) ]
d inspect. ==> Array [1 item] (1->2)
d := Dictionary newFromPairs: #( 1 2 3 4
5 6 ).
d associations reject: [ :asn | (asn key
= 1) and: (asn value = 2) ]
d inspect. ==> Array [2 items] (5->6
3->4)
cheers -ben