I have a question about the strsubstitutor with double $$ varible, I have the following code:
Map<String, Object> params = new HashMap<String, Object>();
params.put("hello", "hello");
String templateString = "The ${hello} $${test}.";
StrSubstitutor sub = new StrSubstitutor(params);
String resolvedString = sub.replace(templateString);
System.out.println(resolvedString);
The output is hello ${test}
If the test
variable is with double $
, and it can not be replaced, why the output is ${test}
? Should not be still $${test}
?