Mark Mintoff My superpower is common sense


JavaScript String.Format

How awesome would it be to have C#'s String.Format, or PHP's printf in JavaScript? "Quite so" says I, rather smugly. Well, here it is: Usage is simple, and follows the same functionality as that found in C#'s String.Format. Honestly, I just don't like PHP's way of tossing in '%s' everywhere. Here's an example, using a JQuery selector to find an object with a given ID, stored in a var: And that's all there is to it! Happy coding!
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)