首次提交

This commit is contained in:
duan
2024-06-06 11:48:06 +08:00
parent 7d3ace3cd2
commit 3fe43d0841
270 changed files with 51481 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
function trim(str, pos = 'both') {
if (pos == 'both') {
return str.replace(/^\s+|\s+$/g, "");
} else if (pos == "left") {
return str.replace(/^\s*/, '');
} else if (pos == 'right') {
return str.replace(/(\s*$)/g, "");
} else if (pos == 'all') {
return str.replace(/\s+/g, "");
} else {
return str;
}
}
export default trim