Hi
Following is the script written first to match the values from one array to another and then replace the values in an array with the values stored in 3rd array…well sounds confusing…just have a look at it…
info=[“M”, “12/12/2000”];
search=[“Gender”, “date”];
b=[“gender”, “date”];
String.prototype.searchReplace=function(find,replace) {
return this.split(find).join(replace);
}
var myString = “{gender}”;
//trace(data[0]);
if(search[0].toLowerCase() eq b[0]){
var newString = myString.searchReplace(search[0], info[0]);
trace(newString);
}
Can anybody tell me why my string is not getting replaced…in the above code…I want my output to be…{M}…
thx