// ConcatStrings concatenates each string in the src slice with prefix and postfix and returns a new slice
190093
func ConcatStrings(src []string, prefix string, postfix string) []string {
	var buf bytes.Buffer
	ret := make([]string, len(src))
	for i, s := range src {
		buf.WriteString(prefix)
		buf.WriteString(s)
		buf.WriteString(postfix)
		ret[i] = buf.String()
		buf.Reset()
	}
	return ret
}
1020994
func FlattenString(nestedstr, prefix string, style SeparatorStyle) (string, error) {
	var nested map[string]interface{}
	err := json.Unmarshal([]byte(nestedstr), &nested)
	if err != nil {
		return "", err
	}

	flatmap, err := Flatten(nested, prefix, style)
	if err != nil {
		return "", err
	}

	flatb, err := json.Marshal(&flatmap)
	if err != nil {
		return "", err
	}

	return string(flatb), nil
}
271537
func NewStrings(into *[]string, v []string) *StringsValue {
	*into = v
	return (*StringsValue)(into)
}
298615
func unionStringSets(a, b map[string]struct{}) map[string]struct{} {
	other := make(map[string]struct{})
	for k := range a {
		other[k] = struct{}{}
	}
	for k := range b {
		other[k] = struct{}{}
	}
	return other
}
897339
func (pp protocolPorts) portStrings(protocol string) []string {
	var result []string
	ports := pp[protocol]
	for _, pr := range ports {
		portStr := fmt.Sprintf("%d", pr.FromPort)
		if pr.FromPort != pr.ToPort {
			portStr = fmt.Sprintf("%s-%d", portStr, pr.ToPort)
		}
		result = append(result, portStr)
	}
	return result
}
673244
func CompileStrs(regStrs []string) (*regexp.Regexp, error) {
	if len(regStrs) == 0 {
		return nil, fmt.Errorf("regStrs must be greater than or equal to 1")
	}
	regStr := "(" + strings.Join(regStrs, "|") + ")"
	re, err := regexp.Compile(regStr)
	if err != nil {
		return nil, err
	}
	return re, nil
}
984122
func (g *Globber) globStrings(list []string, dir, pattern string, matches []string) ([]string, error) {
	m := matches
	matchtree := g.config.GlobStar && g.hasGlobStar(pattern)
	paths := g.filepaths(list, dir, matchtree)
	dirlen := len(dir)
	if dir != "" {
		dirlen++
	}
	for _, path := range paths {
		matched, err := g.Match(pattern, path[dirlen:])
		if err != nil {
			return m, err
		}
		if matched {
			m = append(m, path)
		}
	}
	return m, nil
}
337702
func ConcatSlash(strs ...string) string {
	out := bytes.Buffer{}
	for _, s := range strs {
		if strings.HasSuffix(s, "/") {
			out.WriteString(s)
		} else {
			out.WriteString(s)
			out.WriteByte('/')
		}
	}

	return string(out.Bytes())
}
601429
func PrefixLines(s string, prefix string) string {
	lines := strings.Split(s, "\n")
	for i, l := range lines {
		lines[i] = prefix + l
	}
	return strings.Join(lines, "\n")
}
537133
func (ctx *Context) FormStrings(key string, defaults ...[]string) []string {
	return (*Forms)(ctx.req).MustStrings(key, defaults...)
}
50312
func builtinConcatWS(args []types.Datum, _ context.Context) (d types.Datum, err error) {
	var sep string
	s := make([]string, 0, len(args))
	for i, a := range args {
		if a.IsNull() {
			if i == 0 {
				return d, nil
			}
			continue
		}
		ss, err := a.ToString()
		if err != nil {
			return d, errors.Trace(err)
		}

		if i == 0 {
			sep = ss
			continue
		}
		s = append(s, ss)
	}

	d.SetString(strings.Join(s, sep))
	return d, nil
}
379926
func BytesToStrings(a [][]byte) []string {
	s := make([]string, 0, len(a))
	for _, v := range a {
		s = append(s, string(v))
	}
	return s
}
493327
func (bf *BFlags) AddStrings(name string) *Flag {
	flag := bf.addFlag(name, stringsType)
	if flag == nil {
		return nil
	}
	return flag
}
900531
func Concat(slices ...[]interface{}) []interface{} {
	offset := 0
	for _, slice := range slices {
		offset += len(slice)
	}
	concat := make([]interface{}, offset)
	offset = 0
	for _, slice := range slices {
		for i, e := range slice {
			concat[offset+i] = e
		}
		offset += len(slice)
	}
	return concat
}
1258987
func PrunePrefixes(prefixes []string) []string {
	prunedPrefixes := []string{}
	for i := 0; i < len(prefixes); i++ {
		foundPrefix := false
		for j := 0; j < len(prefixes); j++ {
			if i == j {
				continue
			}
			if strings.HasPrefix(prefixes[i], prefixes[j]) {
				foundPrefix = true
			}
		}
		if !foundPrefix {
			prunedPrefixes = append(prunedPrefixes, prefixes[i])
		}
	}
	return prunedPrefixes
}
76810
func chunkStrings(s []*string, size int) [][]*string {
	var chunks [][]*string
	for len(s) > 0 {
		end := size
		if len(s) < size {
			end = len(s)
		}

		chunks = append(chunks, s[0:end])
		s = s[end:]
	}
	return chunks
}
199723
func sortedConcatStringMap(m map[string]*string) string {
	var strList []string
	mapKeys := sortStringMapKeys(m)
	for _, key := range mapKeys {
		strList = append(strList, key, *m[key])
	}
	return strings.Join(strList, "-")
}