mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-01-03 20:53:09 +03:00
Update groovy.html.markdown
This commit is contained in:
parent
d810a71b76
commit
35ba352668
@ -99,7 +99,7 @@ technologies.sort()
|
|||||||
// To sort without mutating original, you can do:
|
// To sort without mutating original, you can do:
|
||||||
sortedTechnologies = technologies.sort( false )
|
sortedTechnologies = technologies.sort( false )
|
||||||
|
|
||||||
/*** Manipulating Lists ***/
|
/*** Manipulating Lists ***/e
|
||||||
|
|
||||||
//Replace all elements in the list
|
//Replace all elements in the list
|
||||||
Collections.replaceAll(technologies, 'Gradle', 'gradle')
|
Collections.replaceAll(technologies, 'Gradle', 'gradle')
|
||||||
@ -205,7 +205,7 @@ assert x == "worked"
|
|||||||
|
|
||||||
displayName = user.name ? user.name : 'Anonymous'
|
displayName = user.name ? user.name : 'Anonymous'
|
||||||
|
|
||||||
//We can write like this:
|
//We can write it:
|
||||||
displayName = user.name ?: 'Anonymous'
|
displayName = user.name ?: 'Anonymous'
|
||||||
|
|
||||||
//For loop
|
//For loop
|
||||||
|
Loading…
Reference in New Issue
Block a user