Possible duplicate:
JavaScript equivalent of printf / string.format
I'm not sure what the exact expression is (string substitution?), But many languages (C, VB, C #, etc.) offer similar mechanisms for dynamically building a string. Below is an example in C #:
string firstName = "John";
string lastName = "Doe";
string sFinal = string.Format(" Hello {0} {1} !", firstName, lastName);
I would like to do the same in JavaScript. Can anyone shed some light?
Thank,
source
share