diff options
author | Marvin Borner | 2018-11-07 22:10:16 +0100 |
---|---|---|
committer | Marvin Borner | 2018-11-07 22:10:17 +0100 |
commit | 954583f3d56fbfb60321725f13ad092e536e3737 (patch) | |
tree | a0505a763797582c61fd8c2f90b422456d8874c9 /node_modules/locutus/php/strings/substr_replace.js | |
parent | 1c355e6e956a4e507ed5436d0c814ba9c3a1deb2 (diff) |
Removed node_modules
Diffstat (limited to 'node_modules/locutus/php/strings/substr_replace.js')
-rw-r--r-- | node_modules/locutus/php/strings/substr_replace.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/node_modules/locutus/php/strings/substr_replace.js b/node_modules/locutus/php/strings/substr_replace.js deleted file mode 100644 index 9778789..0000000 --- a/node_modules/locutus/php/strings/substr_replace.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -module.exports = function substr_replace(str, replace, start, length) { - // eslint-disable-line camelcase - // discuss at: http://locutus.io/php/substr_replace/ - // original by: Brett Zamir (http://brett-zamir.me) - // example 1: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 0) - // returns 1: 'bob' - // example 2: var $var = 'ABCDEFGH:/MNRPQR/' - // example 2: substr_replace($var, 'bob', 0, $var.length) - // returns 2: 'bob' - // example 3: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 0, 0) - // returns 3: 'bobABCDEFGH:/MNRPQR/' - // example 4: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', 10, -1) - // returns 4: 'ABCDEFGH:/bob/' - // example 5: substr_replace('ABCDEFGH:/MNRPQR/', 'bob', -7, -1) - // returns 5: 'ABCDEFGH:/bob/' - // example 6: substr_replace('ABCDEFGH:/MNRPQR/', '', 10, -1) - // returns 6: 'ABCDEFGH://' - - if (start < 0) { - // start position in str - start = start + str.length; - } - length = length !== undefined ? length : str.length; - if (length < 0) { - length = length + str.length - start; - } - - return [str.slice(0, start), replace.substr(0, length), replace.slice(length), str.slice(start + length)].join(''); -}; -//# sourceMappingURL=substr_replace.js.map
\ No newline at end of file |