Skip to content

Instantly share code, notes, and snippets.

@KentaroArai
Created October 10, 2010 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KentaroArai/619102 to your computer and use it in GitHub Desktop.
Save KentaroArai/619102 to your computer and use it in GitHub Desktop.
// 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