mm_expand 2.3.7 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/string.js +6 -9
- package/package.json +1 -1
package/lib/string.js
CHANGED
|
@@ -251,19 +251,16 @@ String.prototype.right = function (delimiter, retain) {
|
|
|
251
251
|
};
|
|
252
252
|
/**
|
|
253
253
|
* 取文本之间
|
|
254
|
-
* @param {string}
|
|
255
|
-
* @param {string}
|
|
256
|
-
* @param left_delimiter
|
|
257
|
-
* @param left_deli
|
|
258
|
-
* @param right_delimiter
|
|
259
|
-
* @param right_deli
|
|
254
|
+
* @param {string} left_str 索引的左边字符
|
|
255
|
+
* @param {string} right_str 索引的右边字符
|
|
260
256
|
* @param {boolean} retain 当索引字符不存在时是否保留右边
|
|
261
257
|
* @returns {string} 截取后的字符串
|
|
262
258
|
*/
|
|
263
|
-
String.prototype.between = function (
|
|
264
|
-
let str = this.right(
|
|
265
|
-
return str.left(
|
|
259
|
+
String.prototype.between = function (left_str, right_str, retain) {
|
|
260
|
+
let str = this.right(left_str, retain);
|
|
261
|
+
return str.left(right_str, retain);
|
|
266
262
|
};
|
|
263
|
+
|
|
267
264
|
/**
|
|
268
265
|
* 替换所有字符串
|
|
269
266
|
* @param {string} search 被替换的字符串
|