Thanks for your help but sadly doesn't work as expected. Look:
Map<String, String> map = new HashMap<String, String>();
map.put("version", "1");
StrSubstitutor strSubstitutor = new StrSubstitutor(map, "$", "");
strSubstitutor.setVariableSuffixMatcher(StrMatcher.trimMatcher());
System.out.println(strSubstitutor.replace("The $version is
awesome"));
prints: The 1is awesome
Notice that it eats the white space.
Alex.
El dt., 17 nov. 2015 a les 23:19, Woonsan Ko (<[email protected]>) va
escriure:
> I think Jörg is right.
>
> You may change the suffix StrMather through
> #setVariableSuffixMatcher() on a StrSubstitutor.
> I haven't tried it, but it should be something like this example:
>
> final Map<String, V> valueMap = ...;
> StrSubstitutor subst = new StrSubstitutor(valuesMap, "$", ""); //
> NONE_MATCHER for suffix initially
> subst.setVariableSuffixMatcher(StrMatcher.trimMatcher());
>
> HTH,
>
> Woonsan
>
>
> On Tue, Nov 17, 2015 at 2:20 PM, Jörg Schaible <[email protected]>
> wrote:
> > Alex Soto wrote:
> >
> >> Hi, thank you for your answers, Jörg I think that StrMatcher is for
> >> implementing where you want to get information to be replaced on the
> >> string, not for parsing issues.
> >
> > Instead of guessing, I'd rather have a look into the Javadocs of
> > StrSubstitutor.
> >
> > Cheers,
> > Jörg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [email protected]
> > For additional commands, e-mail: [email protected]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>