我对带有双 $$ 变量的 strsubstitutor 有疑问,我有以下代码:
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);
输出是hello ${test}
如果test
变量是 double $
,并且不能被替换,为什么输出是${test}
?不应该是静止的$${test}
吗?