trimRight.js 310 B

12345678910111213
  1. var toValueString = require('./toValueString')
  2. /**
  3. * 去除字符串右边的空格
  4. *
  5. * @param {String} str 字符串
  6. * @return {String}
  7. */
  8. function trimRight (str) {
  9. return str && str.trimRight ? str.trimRight() : toValueString(str).replace(/[\s\uFEFF\xA0]+$/g, '')
  10. }
  11. module.exports = trimRight