// GetString return the value for a String object
// This function is a bit slower than GetStringUTF8, since the conversion from
// []byte to string needs a memory allocation.
196531
func (s Slice) GetString() (string, error) {
	bytes, err := s.GetStringUTF8()
	if err != nil {
		return "", WithStack(err)
	}
	return string(bytes), nil
}
753300
func (c *Context) GetString(key string) (s string) {
	if val, ok := c.Get(key); ok && val != nil {
		s, _ = val.(string)
	}
	return
}
40683
func (vals Values) Get(k string) string {
	if vals == nil {
		return ""
	}
	if v, ok := vals[k]; ok && len(v.Values) > 0 {
		return string(v.Values[0].Value)
	}
	return ""
}
313833
func GetString(code dhcp4.OptionCode, o dhcp4.Options) string {
	v := o.Get(code)
	if v == nil {
		return ""
	}
	return string(v)
}
185948
func (c ConfigAttributes) GetString(attrName string, defaultValue string) string {
	if val, ok := c[attrName]; ok {
		return val.(string)
	}
	return defaultValue
}
734862
func GetString(req *http.Request, key interface{}) string {
	crc := getContextReadCloser(req)
	if value, ok := crc.Context()[key]; ok {
		if typed, ok := value.(string); ok {
			return typed
		}
	}
	return ""
}
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
}
202296
func GetAgeString(t time.Time) string {
	if t.IsZero() {
		return "?"
	}

	sinceNow := time.Since(t)
	minutes := sinceNow.Minutes()
	years := int(math.Floor(minutes / 525600))
	months := int(math.Floor(minutes / 43800))
	days := int(math.Floor(minutes / 1440))
	hours := int(math.Floor(minutes / 60))

	if years > 0 {
		return fmt.Sprintf("%dy", years)
	}
	if months > 0 {
		return fmt.Sprintf("%dM", months)
	}
	if days > 0 {
		return fmt.Sprintf("%dd", days)
	}
	if hours > 0 {
		return fmt.Sprintf("%dh", hours)
	}
	if int(minutes) > 0 {
		return fmt.Sprintf("%dm", int(minutes))
	}

	return "< 1m"
}
954329
func (s *Session) GetString(key string) string {
	if value := s.Get(key); value != nil {
		if v, ok := value.(string); ok {
			return v
		}

		if v, ok := value.(int); ok {
			return strconv.Itoa(v)
		}

		if v, ok := value.(int64); ok {
			return strconv.FormatInt(v, 10)
		}
	}

	return ""
}
781458
func (a Tags) GetString(key string) string {
	return string(a.Get([]byte(key)))
}
805763
func GetString(data []byte, keys ...string) (val string, err error) {
	v, t, _, e := Get(data, keys...)

	if e != nil {
		return "", e
	}

	if t != String {
		return "", fmt.Errorf("Value is not a string: %s", string(v))
	}

	// If no escapes return raw conten
	if bytes.IndexByte(v, '\\') == -1 {
		return string(v), nil
	}

	return ParseString(v)
}
78688
func (d *Context) GetString(i int) string {
	if s := C.duk_get_string(d.duk_context, C.duk_idx_t(i)); s != nil {
		return C.GoString(s)
	}
	return ""
}
679762
func (v *String) Get() string {
	v.mu.Lock()
	s := v.s
	v.mu.Unlock()
	return s
}
854929
func (reader PluginConfigReaderWithError) GetString(key string, defaultValue string) (string, error) {
	key = reader.config.registerKey(key)
	if reader.HasValue(key) {
		value, err := reader.config.Settings.String(key)
		return tstrings.Unescape(value), err
	}
	return defaultValue, nil
}
204015
func (meta Metadata) TryGetValueString(key string) (string, bool) {
	data, exists := meta.TryGetValue(key)
	return string(data), exists
}
573731
func (s *Session) GetStrings(key string, def []string) []string {
	v, ok := s.Values[key]
	if !ok {
		return def
	}

	valinf := v.([]interface{})
	vals := make([]string, len(valinf))
	for i := 0; i < len(valinf); i++ {
		vals[i] = valinf[i].(string)
	}

	return vals
}
669088
func (v *Xtruct3) GetStringThing() (o string) {
	if v != nil && v.StringThing != nil {
		return *v.StringThing
	}

	return
}