Browsing articles from "October, 2011"
Oct
14
2011

Coast to Coast with dojo.string.substitute

sanfrancisco3

Have you ever written JavaScript that injects values into the middle of a string? Did you slice, substring, and RegExp your way to victory? You probably did. Unless great care is taken, this approach is fragile and produces code that is almost certainly difficult to read. Dojo provides help for this problem via an incredibly convenient utility for performing parametrized substitutions on a string, dojo.string.substitute.