(string, replacement)
| 860 | } |
| 861 | |
| 862 | _replaceString(string, replacement) { |
| 863 | const { original } = this; |
| 864 | const index = original.indexOf(string); |
| 865 | |
| 866 | if (index !== -1) { |
| 867 | if (typeof replacement === 'function') { |
| 868 | replacement = replacement(string, index, original); |
| 869 | } |
| 870 | if (string !== replacement) { |
| 871 | this.overwrite(index, index + string.length, replacement); |
| 872 | } |
| 873 | } |
| 874 | |
| 875 | return this; |
| 876 | } |
| 877 | |
| 878 | replace(searchValue, replacement) { |
| 879 | if (typeof searchValue === 'string') { |