// returns first index of a given string
171259
func StringSlicePos(slice []string, value string) int {
	for p, v := range slice {
		if v == value {
			return p
		}
	}
	return -1
}
663749
func (s *IndicesDeleteService) Index(index []string) *IndicesDeleteService {
	s.index = index
	return s
}
309345
func lowerFirst(s string) string {
	if s == "" {
		return ""
	}
	r, n := utf8.DecodeRuneInString(s)
	return string(unicode.ToLower(r)) + s[n:]
}
635651
func (r *raftLog) FirstIndex() (uint64, error) {
	r.RLock()
	idx, err := r.getIndex(true)
	r.RUnlock()
	return idx, err
}
1256172
func index(tokens []string, sep string) int {
	for index, token := range tokens {
		if token == sep {
			return index
		}
	}
	return -1
}
1233683
func StringArrayRemoveFirst(a []string) []string {
	n := len(a)
	if n > 0 {
		copy(a[:n-1], a[1:])
		a = a[:n-1]
	}
	return a
}
304337
func (v List) Index(i int) Value {
	if !(0 <= i && i < len(v)) {
		return Undefined{}
	}
	return v[i]
}
622591
func GetLangByIndex(index int) string {
	if index < 0 || index >= len(locales.langs) {
		return ""
	}
	return locales.langs[index]
}
632997
func IndexN(str, sep string, n int) (index int) {
	index, idx, sepLen := 0, -1, len(sep)
	for i := 0; i < n; i++ {
		if idx = strings.Index(str, sep); idx == -1 {
			break
		}
		str = str[idx+sepLen:]
		index += idx
	}

	if idx == -1 {
		index = -1
	} else {
		index += (n - 1) * sepLen
	}

	return
}
1224595
func posString(slice []string, element string) int {
	for index, elem := range slice {
		if elem == element {
			return index
		}
	}
	return -1
}
1306184
func (b *FastLogStore) FirstIndex() (uint64, error) {
	b.mu.Lock()
	defer b.mu.Unlock()
	if b.closed {
		return 0, ErrClosed
	}
	if b.limits {
		return b.min, nil
	}
	b.fillLimits()
	return b.min, nil
}
1374007
func (s *OpenIndexService) Index(index string) *OpenIndexService {
	s.index = index
	return s
}
1045388
func (s *syncLogStore) FirstIndex() (uint64, error) {
	s.mu.Lock()
	defer s.mu.Unlock()
	return s.store.FirstIndex()
}
385299
func GetWordIndex(word string) (int, bool) {
	idx, ok := wordMap[word]
	return idx, ok
}
1247991
func LastIndexOfString(a []string, x string) int {
	return lastIndexOf(len(a), func(i int) bool { return a[i] == x })
}
1373159
func capitalizeFirst(s string) string {
	switch l := len(s); l {
	case 0:
		return s
	case 1:
		return strings.ToLower(s)
	default:
		return strings.ToUpper(string(s[0])) + strings.ToLower(s[1:])
	}
}
1258857
func IndexOfStringInSlice(searchFor string, searchIn []string) int {
	for idx, anItm := range searchIn {
		if anItm == searchFor {
			return idx
		}
	}
	return -1
}