// indexStringInSlice returns the index of the first instance of 'what' in s or -1 if it is not found in s.
516046
func indexStringInSlice(s []string, what string) int {
	for i := range s {
		if s[i] == what {
			return i
		}
	}
	return -1
}
220968
func (roles Roles) StringSlice() []string {
	s := make([]string, 0)
	for _, r := range roles {
		s = append(s, r.String())
	}
	return s
}
1227476
func (slice TagSlice) TagIndex(tagCode int, startingIndex int, endIndex int) int {
	for index := startingIndex; index < endIndex; index++ {
		if slice[index].Code == tagCode {
			return index
		}
	}
	return -1
}
39117
func IsSliceContainsStr(sl []string, str string) bool {
	str = strings.ToLower(str)
	for _, s := range sl {
		if strings.ToLower(s) == str {
			return true
		}
	}
	return false
}
459470
func StringIteratorToSlice(i StringIterator) []string {
	if i == nil {
		return nil
	}

	if si, ok := i.(*StringSliceIterator); ok {
		return si.toSlice()
	}
	var a []string
	for i.Next() {
		a = append(a, i.Value())
	}
	return a
}
502169
func (mmap MarshalMap) StringSliceMap(key string) (map[string][]string, error) {
	return mmap.StringArrayMap(key)
}
739648
func IndexOfString(a []string, x string) int {
	return indexOf(len(a), func(i int) bool { return a[i] == x })
}
1246389
func StringSlice(value []string, name, usage string) *[]string {
	p := new([]string)
	flag.Var(NewStringSlice(value, p), name, usage)
	return p
}
178241
func stringSetSlice(m map[string]struct{}) []string {
	if m == nil {
		return nil
	}

	a := make([]string, 0, len(m))
	for k := range m {
		a = append(a, k)
	}
	sort.Strings(a)
	return a
}
702306
func (s StringSlice) StringSlice() []string {
	ss := []string{}
	for _, tmp := range s {
		if len(tmp) <= 2 {
			continue
		}
		ss = append(ss, tmp)
	}
	return ss
}
1020743
func (mmap MarshalMap) StringSlice(key string) ([]string, error) {
	return mmap.StringArray(key)
}
718719
func (c *Context) StringSlice(name string) []string {
	return lookupStringSlice(name, c.flagSet)
}
199531
func StringToSlice(data string) *Slice {
	return NewSlice(C.CString(data), C.size_t(len(data)))
}
1015056
func isStringInSlice(term string, list []string) bool {
	for _, found := range list {
		if term == found {
			return true
		}
	}
	return false
}
68541
func StringInSlice(sliceString []string, needle string) bool {
	for _, b := range sliceString {
		if b == needle {
			return true
		}
	}
	return false
}
910191
func isSlice(t reflect.Type) bool {
	if t.Kind() == reflect.Ptr {
		t = t.Elem()
	}
	return t.Kind() == reflect.Slice
}
315766
func StringInSlice(valid []string, ignoreCase bool) schema.SchemaValidateFunc {
	return func(i interface{}, k string) (s []string, es []error) {
		v, ok := i.(string)
		if !ok {
			es = append(es, fmt.Errorf("expected type of %s to be string", k))
			return
		}

		for _, str := range valid {
			if v == str || (ignoreCase && strings.ToLower(v) == strings.ToLower(str)) {
				return
			}
		}

		es = append(es, fmt.Errorf("expected %s to be one of %v, got %s", k, valid, v))
		return
	}
}