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

module.exports = function Index(s, sep) {
  //  discuss at: http://locutus.io/golang/strings/Index
  // original by: Kevin van Zonneveld (http://kvz.io)
  //   example 1: Index('Kevin', 'K')
  //   returns 1: 0
  //   example 2: Index('Kevin', 'Z')
  //   returns 2: -1

  return (s + '').indexOf(sep);
};
//# sourceMappingURL=Index2.js.map