strLeftBack.js 228 B

12345678
  1. var makeString = require('./helper/makeString');
  2. module.exports = function strLeftBack(str, sep) {
  3. str = makeString(str);
  4. sep = makeString(sep);
  5. var pos = str.lastIndexOf(sep);
  6. return~ pos ? str.slice(0, pos) : str;
  7. };