Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
None
-
None
-
None
-
None
Description
Desired usage:
def words = ['Ant', 'Dog'] def aWord = { w -> w.startsWith('A') } def makeLower = { w -> w.toLowerCase() } words.updateMatching(aWord, makeLower)
Groovy code snippet elaborating desired behavior (for a mutating version, but perhaps one that returns a modified list is the better way to go):
(0..<words.size()).each { i ->
def w = words[i]
if (aWord(w)) words[i] = makeLower(w)
}
println words
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-4253 findResult object/collection/map enhancement patch
- Closed