I have a java string that could be along the lines of
<code>word1 word2 {param1}, word3 word4 {param2} {param3}
</code>
<code>word1 word2 {param1}, word3 word4 {param2} {param3}
</code>
word1 word2 {param1}, word3 word4 {param2} {param3}
I want to write a function that takes the above item as String
and also takes a map that has key value paris for each of param1
, param2
, param3
and replaces with the value from hashmap.
How do I do this? I want to be precise {param1}
to be replaced by the value that will be returned by map for key param1
. During replacement, I want the curly braces gone too.