use(StringUtils) {Not only that but the JetGroovy plugin for IntelliJ IDEA will autocomplete all the new String methods inside the use block.
println 'i can has cheezburger'.substringAfter('i can has ') // prints 'cheezburger'
}
Friday 14 November 2008
Fun With Groovy Categories
Just a quick stupid trick I discovered. Commons Lang's StringUtils class works quite nicely as a category for String, e.g.
Labels:
categories,
groovy
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment