My string is:
var str = "hi {0} your contact is {1}";
{0},{1} indicates dynamic data we can substitute to that string. Have to find "{0}" and replace it with objects in array where array contains:
var my_arr=[[{"data":"priya"},{"data":"reena"},{"data":"mathew"}],[{"data":"123456"},{"data":"745896"},{"data":"236521"}]]
and I want to replace {0} with my_arr[0] data and {1} with my_arr[1] data. Finally my output would be like this :
var result={"hi priya your contact is 123456","hi reena your contact is 745896","hi mathew your contact is 236521"}.
please help me to do this, any changes in array format can be acceptable. Thanks in advance.