6 Aug 13:12
[groovy-dev] escape character for $ in groovy
From: Groovy Links <rameshsmw@...>
Subject: [groovy-dev] escape character for $ in groovy
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-08-06 11:13:14 GMT
Subject: [groovy-dev] escape character for $ in groovy
Newsgroups: gmane.comp.lang.groovy.devel
Date: 2008-08-06 11:13:14 GMT
hi,
i have a method in groovy which gets a parameter as string. the string has a
value "This is to test $test_id. now i want to replace the $test_id with
"Missing". what is the exact escape character for $.
Note: the string which comes as a parameter has the $ symbol.
def static String replace(String footerText, String replace)
{
footerText = footerText.replaceAll("\$",replace);
}
in the above method the string footertext will hold "This is to test
$test_id". now i want to replace $test_id with "missing". but the above
replace statement doesn't work.
can anyone tell the escape character for $ for the above scenario?
thanks
--
--
View this message in context: http://www.nabble.com/escape-character-for-%24-in-groovy-tp18849032p18849032.html
Sent from the groovy - dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
(Continue reading)
RSS Feed