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