summaryrefslogtreecommitdiff
path: root/node_modules/locutus/golang/strings/LastIndex.js
blob: 2d793a6c90af57ff7257b076311f217aa6d63b15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"use strict";

module.exports = function LastIndex(s, sep) {
  //  discuss at: http://locutus.io/golang/strings/LastIndex
  // original by: Kevin van Zonneveld (http://kvz.io)
  //    input by: GopherJS (http://www.gopherjs.org/)
  //   example 1: LastIndex('go gopher', 'go')
  //   returns 1: 3
  //   example 2: LastIndex('go gopher', 'rodent')
  //   returns 2: -1

  return parseInt(s.lastIndexOf(sep), 10) >> 0;
};
//# sourceMappingURL=LastIndex.js.map