Created
October 10, 2010 09:27
-
-
Save KentaroArai/619102 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g100pon #2 リスト操作(基礎編:CRUD系操作とイテレーション) | |
def list = [1, "one", 2] | |
// 1番目をread | |
println list[0] | |
// 2番目をupdate | |
list[1] = "update" | |
println list[1] | |
// 3番目を削除 | |
println "before removed size is " + list.size | |
list.remove(2) | |
println "after removed size is " + list.size | |
// iteration | |
println "イテレーション" | |
list.each(){println "${it}"}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment