Skip to content

Commit fc1aea5

Browse files
committed
Update str_replace.js
1 parent a48579f commit fc1aea5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

functions/strings/str_replace.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ function str_replace(search, replace, subject, count) {
2323
// bugfixed by: Glen Arason (http://CanadianDomainRegistry.ca)
2424
// example 3: str_replace(Array('S','F'),'x','ASDFASDF');
2525
// returns 3: 'AxDxAxDx'
26-
// bugfixed by: Glen Arason (http://CanadianDomainRegistry.ca)
27-
// : Corrected count calculation
28-
26+
// bugfixed by: Glen Arason (http://CanadianDomainRegistry.ca) Corrected count
27+
// example 4: str_replace(['A','D'], ['x','y'] , 'ASDFASDF' , 'cnt');
28+
// returns 4: 'xSyFxSyF' cnt = 0 (incorrect before fix)
29+
// returns 4: 'xSyFxSyF' cnt = 4 (correct after fix)
30+
2931
var i = 0,
3032
j = 0,
3133
temp = '',

0 commit comments

Comments
 (0)