trimLeft.js 306 B

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