Hi I have a HashMap with {key,value} as {var1:10},{var2:20} etc.
I have another hashMap with {key,value} as {value,import android droid = android.Android() average = (var1 + var2)/2 droid.makeToast('Hello World' +str(average))}.
I want to replace the variable names with values from the first hashMap.
Can anyone help me how to do this? Thanks in advance!
Assuming that your first map is of type
HashMap<String, Integer>and your second map is of typeHashMap<String, String>you could iterate over both maps and perform string replacement: