I have a string with the same character in it several times and I want to replace each occurrence of this character with a different string from an array. I.e. just like in prepared statements:
String: "SELECT * FROM x WHERE a = ? AND b = ?"
Array: ['alpha', 'beta']
Result: "SELECT * FROM x WHERE a = alpha AND b = beta"
If you have control over what the replacement character is, use
sprintfor
vsprintf:And even if you don’t: