Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-23 Thread Woonsan Ko
Gotcha! Now I can understand the escape character means: Ignore the following variable reference. Thank you so much for the explanation with a good solution. Cheers, Woonsan On Thu, Jul 23, 2015 at 2:42 PM, Anthony Brice anthonybr...@lateachiever.com wrote: Sorry, the second sentence in the

Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-23 Thread Anthony Brice
No problem! I'm happy to have helped. Happy substituting! Cheers, Anthony Brice On Thu, Jul 23, 2015 at 1:23 PM, Woonsan Ko woon...@apache.org wrote: Gotcha! Now I can understand the escape character means: Ignore the following variable reference. Thank you so much for the explanation with a

Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-23 Thread Woonsan Ko
Hi Anthony, Putting '$20.00' into the map is not an option in my use case, so I tried to use a different escape character. But it doesn't seem to be working either (another bug?): @Test public void testReplaceEscapingDollarSign() { values.put(amount, 20.00); final

Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-23 Thread Woonsan Ko
Sorry, the example was incomplete. It should be like this: @Test public void testReplaceEscapingDollarSign() { values.put(amount, 20.00); final StrSubstitutor sub = new StrSubstitutor(values); sub.setEscapeChar(''); String replaceTemplate = The ${animal}

Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-23 Thread Woonsan Ko
On Thu, Jul 23, 2015 at 4:21 AM, Jörg Schaible joerg.schai...@swisspost.com wrote: Hi Woonsan, Woonsan Ko wrote: Hi there, I tried to use the following, expecting ...ick brown fox paid $20.00 to jump over the la…: // In org.apache.commons.lang3.text.StrSubstitutorTest.java locally

Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-23 Thread Anthony Brice
The escape character just tells StrSubstitutor Ignore the following variable reference. When you change the default escape character, you don't need to use it get a dollar sign before a variable reference in your interpolated string. Try the following: @Test public void

Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-23 Thread Jörg Schaible
Hi Woonsan, Woonsan Ko wrote: Hi there, I tried to use the following, expecting ...ick brown fox paid $20.00 to jump over the la…: // In org.apache.commons.lang3.text.StrSubstitutorTest.java locally // after cloning https://github.com/woonsan/commons-lang. @Test public

Re: [lang] StrSubstitutor - a dollar sign before a variable

2015-07-22 Thread Anthony Brice
It's not a bug---that's a feature! :p From the javadoc: If this character ['$'] is placed before a variable reference, this reference is ignored and won't be replaced. So even when you use three dollar signs, you still have a variable reference (${amount}) with the escape character placed before

[lang] StrSubstitutor - a dollar sign before a variable

2015-07-22 Thread Woonsan Ko
Hi there, I tried to use the following, expecting ...ick brown fox paid $20.00 to jump over the la…: // In org.apache.commons.lang3.text.StrSubstitutorTest.java locally // after cloning https://github.com/woonsan/commons-lang. @Test public void testReplaceEscapingDollarSign() {