Guest User

Untitled

a guest
Apr 29th, 2012
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. String.metaClass.replace << { int i, String s ->
  2. assert s.size() == 1
  3. delegate.value[i] = s as char
  4. }
  5. def x = 'groovy'
  6. x.replace(3, 'X')
  7. assert x == 'groXvy'
Advertisement
Add Comment
Please, Sign In to add comment