##JavaScript (ES6), 100 95 bytes
JavaScript (ES6), 100 95 bytes
(a,b,c)=>1?(t=[...a].map(e=>b[0]==e?(u=c[0],b=b.slice(1),c=c.slice(1),u):e).join``,b==""?t:a):a
This is a valid JavaScript Lambda function. Outputs as function return
. Takes in three arguments (a,b,c
). Add f=
at the beginning and invoke like f(arg1,arg2,arg3)
.
f=(a,b,c)=>1?(t=[...a].map(e=>b[0]==e?(u=c[0],b=b.slice(1),c=c.slice(1),u):e).join``,b==""?t:a):a
console.log(f(prompt("Value for A"),prompt("Value for B"),prompt("Value for C")))