Created
February 7, 2014 14:29
-
-
Save konijn/8863555 to your computer and use it in GitHub Desktop.
Tiny Templates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fillTemplate( s ) | |
{ //Replace ~ with further provided arguments | |
for( var i = 1, a = s.split('~'), s = '' ; i < arguments.length ; i++ ) | |
s = s + a.shift() + arguments[i]; | |
return s + a.join(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment