Skip to content

Commit e28af7e

Browse files
committed
added string interpolation util
1 parent 48b0fbd commit e28af7e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/seed.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
:EEE7 ,ws,`|EEL`JEEL`JEE)`JEEL zE5` E3. / [EE3 ,w. zE2` Ek .zE5^JZE3.,6EF [3
88
{EEE. VEE7.EE2 AE3. EEV ZEEL{EEL ws. ; [EE1 EEEt{E3. JEELEE3. JE5LJEEF ,w,
99
\EEk,,>^ JEEL,@EEF ZE5L,ZE5^ "Q3. V2`. \EEk,,J' "Q[ yE2^ VE[_zEE[,"QEL V5F
10-
,ss :EE7 ;EEF L,szzw.. ,., ``
11-
\E5.,E5F EE1. /; ``*4EEEZhw._ EEEL
12-
```` `` JEEE. `"45EEEhw.,,,]
10+
,ss :EE7 ;EEF L,szzw.. ,., ``
11+
\E5.,E5F EE1. /; ``*4EEEZhw._ EEEL
12+
```` `` JEEE. `"45EEEhw.,,,]
1313
1414
From 2010 till ∞
1515
typecode-js v 0.1
@@ -150,6 +150,18 @@ define(['jquery'], function($) {
150150
window.clearTimeout(timer);
151151
timer = window.setTimeout(execute, delay);
152152
};
153+
},
154+
155+
// String interpolation
156+
// var s = interpolate('Hello %', ['world'])
157+
interpolate: function(str, args) {
158+
var i;
159+
if (args) {
160+
for (i = 0; i < args.length; i += 1) {
161+
str = str.replace('%', args[i]);
162+
}
163+
}
164+
return str;
153165
}
154166
};
155167

0 commit comments

Comments
 (0)