Writing a generic function to format strings using bob.js
Hello,
Code:
var string = "My name is {0} and I am {1} years old.";
var result = bob.string.formatString(sFormat, "myname", 25);
I want to write a function such that I can pass the string with required number of arguments and it will return me the formatted string with all {0} , {1}, .. replaced by my passed arguments. Something like:
Code:
function test( string , argument1 , argument2 , ....){