I have a string
String templateString = "The ${animal} jumps over the ${target}.";
valuesMap.put("animal", "quick brown fox");
StrSubstitutor sub = new StrSubstitutor(valuesMap);
String resolvedString = sub.replace(templateString);
But there is no entry for attr target in valuesMap. Final resolvedString would be The quick brown fox jumps over the ${target}.
Instead of ${target}, it need to be empty. Values in templatestring which doesn't have key in map should be empty or null.
required The quick brown fox jumps over the.
How to handle this