Given the string \'Hello ?, welcome to ?\' and the array [\'foo\', \'bar\'], how do I get the string \'Hello foo, welcome to bar\' in
\'Hello ?, welcome to ?\'
[\'foo\', \'bar\']
\'Hello foo, welcome to bar\'
You could use vsprintf. Although if you include sprintf, it's much more than one line.
vsprintf('Hello %s, welcome to %s', [foo, bar]);