How to implement javascript's 'escape' function in grails

Posted by firnnauriel on Stack Overflow See other posts from Stack Overflow or by firnnauriel
Published on 2010-05-07T04:11:24Z Indexed on 2010/05/07 4:18 UTC
Read the original article Hit count: 202

Filed under:

Is there an equivalent of JS 'escape' function in Groovy/Java?

escape('hello world') => hello%20world

I tried this class: http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html, but it didn't work.

Or do i have to implement it?

Thanks.

© Stack Overflow or respective owner

Related posts about groovy