// FindString iterates over a collection of string, returning the first
// string element predicate returns truthy for.
355654
func FindString(s []string, cb func(s string) bool) (string, bool) {
	for _, i := range s {
		result := cb(i)

		if result {
			return i, true
		}
	}

	return "", false
}
264375
func (c *config) GetString(key string, args ...interface{}) string {
	val, err := c.GetStringErr(key, args...)
	if err != nil {
		c.errorHandler(key, err, args...)
	}
	return val
}
1232388
func (s *Session) GetString(key string) string {
	r, _ := s.Get(key).(string)
	return r
}
21906
func (ngram *NGramIndex) GetString(id TokenID) (string, error) {
	return ngram.spool.ReadAt(id)
}
1065260
func (c *Config) GetString(key string) (string, error) {
	val, ok := (*c)[key]
	if !ok {
		return "", ErrNoSuchKey
	}
	s, ok := val.(string)
	if !ok {
		return s, fmt.Errorf("Wrong type for %s (Type:%T Expecting:%T)", key, val, s)
	}
	return val.(string), nil
}
1297782
func (p *Parser) ParseString(s string, v interface{}) error {
	return p.Parse(strings.NewReader(s), v)
}
407813
func (list *List) GetString(idx int) (string, error) {
	value, err := list.Get(idx)
	if err != nil {
		return "", err
	}

	switch value.(type) {
	case *Primative:
		return value.(*Primative).AsString()
	}

	return "", errors.New("could not convert non-primative value to string")
}
189720
func (s *Session) GetString(ctx context.Context, key string) string {
	val := s.Get(ctx, key)
	str, ok := val.(string)
	if !ok {
		return ""
	}
	return str
}
462163
func GetString(key string) (string, error) {
	value, err := Get(key)
	if err != nil {
		return "", err
	}
	switch v := value.(type) {
	case int:
		return strconv.Itoa(v), nil
	case int64:
		return strconv.FormatInt(v, 10), nil
	case string:
		return v, nil
	}
	return "", &InvalidValue{key, "string|int|int64"}
}
1046567
func (t *Template) ParseString(s string) error {
	return t.Parse(strings.NewReader(s))
}
56997
func GetString(n ast.Node) (string, error) {
	if node, ok := n.(*ast.BasicLit); ok && node.Kind == token.STRING {
		return strconv.Unquote(node.Value)
	}
	return "", fmt.Errorf("Unexpected AST node type: %T", n)
}
1287581
func ValidateString(target string, valid []string) (bool, error) {
	found := false

	for _, e := range valid {
		if e == target {
			found = true
		}
	}

	if !found {
		return false, fmt.Errorf("'%s' is not in the allowed list: %s", target, strings.Join(valid, ", "))
	}

	return true, nil
}
776832
func (f *Finder) Find(
	ctx context.Context, ipath ...string) ([]FindResult, error) {

	if len(ipath) == 0 {
		ipath = []string{""}
	}
	var result []FindResult
	for _, p := range ipath {
		results, err := f.find(ctx, p)
		if err != nil {
			return nil, err
		}
		result = append(result, results...)
	}
	return result, nil
}
561257
func ParseString(s string) (*Query, error) {
	return NewParser(strings.NewReader(s)).Parse()
}
1096595
func GetString(key string, defaultValue string) string {
	result, err := factory.GetValue(key).ToString()
	if err != nil {
		return defaultValue
	}
	return result
}
1135191
func (s *Session) GetString(key string, def string) string {
	v, ok := s.Values[key]
	if !ok {
		return def
	}

	return v.(string)
}
672309
func (s strings) Find(in []string, what string) int {
	for i, entry := range in {
		if entry == what {
			return i
		}
	}

	return -1
}