This file contains hidden or 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 str_replace(haystack, needle, replace) { | |
| var haystack_arr = haystack.split(''); | |
| var needle_arr = needle.split(''); | |
| var replace_arr = replace.split(''); | |
| var replace_positions = new Array(); | |
| $.each(haystack_arr, function(key, value) { | |
| if(value == needle_arr[0]) { | |
| var correct_count = 1; | |
| for(i = 1; i < needle_arr.length; i++) { | |
| if(haystack_arr[key + i] == needle_arr[i]) { |
NewerOlder