I have two strings which contains the following substrings: myStringA
and myStringBB;
and a dictionary d
which maps A
and BB
to some other values, lets say d["A"] = "X"
and d["BB"] = "YY"
. I want to replace both of these strings by the following strings:
ThisIsMyStringX
and ThisIsMyStringYY;
. So that I want to replace A
and BB
(which are known for me) by the values from dictionary and leave ;
if present at the end and add ThisIs
and the beginning. How can I achieve that?