UNPKG
pm-xe-utils
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
JavaScript 函数库、工具类
github.com/x-extends/xe-utils
x-extends/xe-utils
pm-xe-utils
/
trim.js
15 lines
(12 loc)
•
298 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var
trimRight =
require
(
'./trimRight'
)
var
trimLeft =
require
(
'./trimLeft'
)
/** * 去除字符串左右两边的空格 * *
@param
{
String
} str 字符串 *
@return
{
String
} */
function
trim
(
str
) {
return
str && str.
trim
? str.
trim
() :
trimRight
(
trimLeft
(str)) }
module
.
exports
= trim