Created
June 27, 2013 07:18
-
-
Save aya-eiya/5874558 to your computer and use it in GitHub Desktop.
ちょっとしたことがGroovy 「リストの文字列表現で要素に任意の引用符つけたい」 ref: http://qiita.com/aya_eiya/items/c9b8e0b3d417dae2a7a3
This file contains hidden or 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
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