Skip to content

Instantly share code, notes, and snippets.

@aya-eiya
Created June 27, 2013 07:18
Show Gist options
  • Save aya-eiya/5874558 to your computer and use it in GitHub Desktop.
Save aya-eiya/5874558 to your computer and use it in GitHub Desktop.
ちょっとしたことがGroovy 「リストの文字列表現で要素に任意の引用符つけたい」 ref: http://qiita.com/aya_eiya/items/c9b8e0b3d417dae2a7a3
List.metaClass.toString = { squate,equate=null ->
if(equate==null) equate = squate
delegate.collect {"${squate}${it}${equate}"}
}
def l = ["a","b","c"];
println l.toString()
println l.toString("'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment