You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
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
|
|
|