import org.apache.commons.lang.text.StrSubstitutor;
Map map = new HashMap();
map.put("DAYS", "2");
map.put("HOURS", "8");
String str = "${DAYS} days and ${HOURS} hours to go";
StrSubstitutor sub = new StrSubstitutor(map);
String resolvedString = sub.replace(str);
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment