// StringReverse 反转字符串, 此操作不会修改原值
330970
func StringReverse(s string) string {
	newBytes := make([]byte, len(s))
	copy(newBytes, s)
	b := BytesReverse(newBytes)
	return *(*string)(unsafe.Pointer(&b))
}
426579
func (n *NFQParser) String() string {

	n.Lock()
	defer n.Unlock()

	return n.nfqStr
}
1065795
func reverse6(slice []string) string {
	for i := 0; i < len(slice)/2; i++ {
		j := len(slice) - i - 1
		slice[i], slice[j] = slice[j], slice[i]
	}
	slice6 := []string{}
	for i := 0; i < len(slice)/4; i++ {
		slice6 = append(slice6, strings.Join(slice[i*4:i*4+4], ""))
	}
	ip := net.ParseIP(strings.Join(slice6, ":")).To16()
	if ip == nil {
		return ""
	}
	return ip.String()
}
1180708
func ExtractAddressFromReverse(reverseName string) string {
	search := ""

	f := reverse

	switch {
	case strings.HasSuffix(reverseName, v4arpaSuffix):
		search = strings.TrimSuffix(reverseName, v4arpaSuffix)
	case strings.HasSuffix(reverseName, v6arpaSuffix):
		search = strings.TrimSuffix(reverseName, v6arpaSuffix)
		f = reverse6
	default:
		return ""
	}

	// Reverse the segments and then combine them.
	return f(strings.Split(search, "."))
}
532904
func String() *StringPrinter {
	w := &bytes.Buffer{}
	f := Colour(w)
	return &StringPrinter{f, w}
}
560745
func (i Format) String() string {
	switch i {
	case FormatInvalid:
		return "FormatInvalid"
	case FormatARGB32:
		return "FormatARGB32"
	case FormatRGB24:
		return "FormatRGB24"
	case FormatA8:
		return "FormatA8"
	case FormatA1:
		return "FormatA1"
	case FormatRGB16565:
		return "FormatRGB16565"
	case FormatRGB30:
		return "FormatRGB30"
	default:
		return fmt.Sprintf("Format(%d)", i)
	}
}
636220
func (q *QRCode) ToString(inverseColor bool) string {
	bits := q.Bitmap()
	var buf bytes.Buffer
	for y := range bits {
		for x := range bits[y] {
			if bits[y][x] != inverseColor {
				buf.WriteString("  ")
			} else {
				buf.WriteString("██")
			}
		}
		buf.WriteString("\n")
	}
	return buf.String()
}
1068178
func (s *Sequence) String() string {
	d := fmt.Sprintf("incremented by %d between %d and %d", s.increment, s.minvalue, s.maxvalue)
	if !s.IsStarted() {
		return fmt.Sprintf("Unstarted Sequence %s", d)
	}
	return fmt.Sprintf("Sequence at %d, %s", s.current, d)
}
249678
func (dec *Decoder) String(v *string) error {
	err := dec.decodeString(v)
	if err != nil {
		return err
	}
	dec.called |= 1
	return nil
}
105592
func (f *Buffer) String() string {
	return string(f.Buff.Bytes()[f.Index:])
}
518762
func (m *mruNonceMap) String() string {
	m.mtx.Lock()
	defer m.mtx.Unlock()

	lastEntryNum := len(m.nonceMap) - 1
	curEntry := 0
	buf := bytes.NewBufferString("[")
	for nonce := range m.nonceMap {
		buf.WriteString(fmt.Sprintf("%d", nonce))
		if curEntry < lastEntryNum {
			buf.WriteString(", ")
		}
		curEntry++
	}
	buf.WriteString("]")

	return fmt.Sprintf("<%d>%s", m.limit, buf.String())
}
1105024
func Reverse(s string) string {
	ss := strings.Split(s, "")
	ns := ""

	for i := len(ss) - 1; i >= 0; i-- {
		ns += ss[i]
	}

	return ns
}
102897
func stringStringMapParser(rd *proto.Reader, n int64) (interface{}, error) {
	m := make(map[string]string, n/2)
	for i := int64(0); i < n; i += 2 {
		key, err := rd.ReadString()
		if err != nil {
			return nil, err
		}

		value, err := rd.ReadString()
		if err != nil {
			return nil, err
		}

		m[key] = value
	}
	return m, nil
}
308160
func Reverse(arg interface{}) Value {
	if val, ok := arg.(Value); ok {
		return val.Reverse()
	}
	return value{value: arg, color: ReverseFm}
}
493829
func (s *Server) Reverse(name string, params ...interface{}) string {
	path, ok := s.namedRoutes[name]
	if !ok {
		log.Warnf("Server routes reverse failed, cannot find named routes %q", name)
		return "/no_such_named_routes_defined"
	}
	if len(params) == 0 || path == "/" {
		return path
	}
	strParams := make([]string, len(params))
	for i, param := range params {
		strParams[i] = fmt.Sprint(param)
	}
	parts := strings.Split(path, "/")[1:]
	paramIndex := 0
	for i, part := range parts {
		if part[0] == ':' || part[0] == '*' {
			if paramIndex < len(strParams) {
				parts[i] = strParams[paramIndex]
				paramIndex++
			}
		}
	}
	return httprouter.CleanPath("/" + strings.Join(parts, "/"))
}
165312
func (v *value) String() string {
	if v.IsUndefined() {
		return "null"
	}
	return fmt.Sprintf("%v", v.raw)
}
700508
func (ls LineString) Reverse() {
	l := len(ls) - 1
	for i := 0; i <= l/2; i++ {
		ls[i], ls[l-i] = ls[l-i], ls[i]
	}
}