Version 1
[yaffs-website] / node_modules / underscore.string / strLeftBack.js
diff --git a/node_modules/underscore.string/strLeftBack.js b/node_modules/underscore.string/strLeftBack.js
new file mode 100644 (file)
index 0000000..0136e20
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function strLeftBack(str, sep) {
+  str = makeString(str);
+  sep = makeString(sep);
+  var pos = str.lastIndexOf(sep);
+  return~ pos ? str.slice(0, pos) : str;
+};