JavaScript string format

JavaScript has no built-in function to formatting strings, like C#  string.Format(). This function solves the issue adding missing functionality.

In order to recognize string objects you should add a property to String prototype. You can find it in the code below isString. The usage of the function looks like this: “text {0}-{1}”.format(“blah1”, “blah2”) => “text blah1-blah2”

No Comments

You can leave the first : )

Leave a Reply