Advertisement
filebot

Groovy MetaClass

Jul 13th, 2014
541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.08 KB | None | 0 0
  1. String.metaClass.pad = { n = 2 -> delegate.padLeft(n, '0') }
  2.  
  3. def t = "1"
  4. t.pad(4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement