Stephen King's non-fiction Books: <g:grep in="${books}" filter="NonFictionBooks.class"> <p>Title: ${it.title}</p> </g:grep><g:grep in="${books.title}" filter="~/.*Groovy.*/"> <p>Title: ${it}</p> </g:grep>
in
- 迭代的对象 filter
- 过滤器接口,例如一个类,正则表达式,或者其他的执行isCase
.