Revision: 30208
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 10, 2010 04:24 by rmariuzzo
Initial Code
/** * Format a string with an array of arguments. * * @param msg A string. * @return A formatted string */ function format(msg) { if (arguments && arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { msg = msg.replace('{'+(i-1)+'}', arguments[i]); } } return msg; }
Initial URL
http://mariuzzo.com/
Initial Description
Initial Title
Format a string with an array of arguments
Initial Tags
javascript, format, text
Initial Language
JavaScript