Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.4
-
None
Description
public static void main(String[] args) {
String s = "The number of ${item} items currently available: ${number}";
String result = StrSubstitutor.replace(s, Collections.singletonMap("item", "monitor"));
System.out.println(result);
}
This results in: "The number of monitor items currently available: ${number}".
I'd need a default value for a placeholder that cannot be resolved.
String result = StrSubstitutor.replace(s, Collections.singletonMap("item", "monitor"), "N/A");
-> "The number of monitor items currently available: N/A".