mingyang_text 2023.2.6 → 2023.2.24
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/package.json +1 -1
- package/text.js +6 -5
package/package.json
CHANGED
package/text.js
CHANGED
@@ -426,13 +426,14 @@ module.exports.do_Base62Decode = func_Base62Decode;
|
|
426
426
|
/**
|
427
427
|
* 按照一定的顺序尝试分割字符串
|
428
428
|
* @param {原始字符串} args_Text
|
429
|
-
* @param {分隔符数组}
|
429
|
+
* @param {分隔符数组} args_DelimiterArray
|
430
430
|
*/
|
431
|
-
function func_Split(args_Text,
|
431
|
+
function func_Split(args_Text, args_DelimiterArray = [",", "-", "_", "/", "|", "~", "*", "+"]) {
|
432
432
|
let temp_Result = [args_Text];
|
433
|
-
for (let u = 0; u <
|
434
|
-
if (args_Text.indexOf(
|
435
|
-
temp_Result = args_Text.split(
|
433
|
+
for (let u = 0; u < args_DelimiterArray.length; u++) {
|
434
|
+
if (args_Text.indexOf(args_DelimiterArray[u]) > -1) {
|
435
|
+
temp_Result = args_Text.split(args_DelimiterArray[u]);
|
436
|
+
temp_Result["delimiter"] = args_DelimiterArray[u];
|
436
437
|
break;
|
437
438
|
}
|
438
439
|
}
|