commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Woonsan Ko <woon...@apache.org>
Subject Re: [lang] StrSubstitutor - a dollar sign before a variable
Date Thu, 23 Jul 2015 14:35:55 GMT
On Thu, Jul 23, 2015 at 4:21 AM, Jörg Schaible
<joerg.schaible@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
>>     // after cloning https://github.com/woonsan/commons-lang.
>>     @Test
>>     public void testReplaceEscapingDollarSign() {
>>         values.put("amount", "20.00");
>>         doTestReplace("The quick brown fox paid $20.00 to jump over
>> the lazy dog.",
>>                       "The ${animal} paid $$${amount} to jump over the
>> ${target}.", true);
>>     }
>>
>> (I put double dollar signs like $$${amount} because $ is the default
>> escape character.)
>>
>> But, the result was:"...ick brown fox paid $${amount} to jump over the
>> la…".
>>
>> Is it a bug or did I miss something?
>
> I'd call it a bug. You escaped the first dollar sign properly.

I think so, too. I've just filed a bug:
- https://issues.apache.org/jira/browse/LANG-1158

Cheers,

Woonsan

>
> Cheers,
> Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message