commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Soto <asot...@gmail.com>
Subject Commons Lang substitution
Date Sat, 14 Nov 2015 19:02:19 GMT
Hi I have two special requirements that I think that Common-Lang
StrSubstitutor does not cover, but I would like to know if it is correct or
not.

The first requirement is that I would like to know if there is a way to
make StrSubstitutor works with using simple character as prefix and no
suffix. For example:

"This is my $name and I am happy"

I have tried  by using new StrSubstitutor(map, "$", "") and
StrSubstitutor(map, "$", " ") but no luck.

I have tried with commons-lang and commons-lang3.

The second one is that I would like to know if there is a way to force that
in case of no substitution found, the var is replaced with white space
instead of untouch it.

Thank you very much for your attention.

Alex.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message