Convenience to string method.
429718
def device_characteristics_str(self, indent):
        
        s = "{}\n".format(self.label)
        s += indent + "MAC Address: {}\n".format(self.mac_addr)
        s += indent + "IP Address: {}\n".format(self.ip_addr)
        s += indent + "Port: {}\n".format(self.port)
        s += indent + "Power: {}\n".format(str_map(self.power_level))
        s += indent + "Location: {}\n".format(self.location)
        s += indent + "Group: {}\n".format(self.group)
        return s
431459
public String asString() {
		if (current == null)
			return null;
		if (current instanceof String)
			return (String) current;
		return current.toString();
	}
835515
def mapping_to_str(mapping):
    """"""
    result = ["<"]
    for i, (key, value) in enumerate(mapping.items()):
        if i > 0:
            result.append(",")
        result += [key, "=", serialize_for_header(key, value)]
    result += [">"]
    return "".join(result)
598180
def set_string(self, string):
        """"""
        self.string = string
        self.length = len(string)
        self.reset_position()
104427
public static String methodToString(final Class<?> type, final Method method) {
        final StringBuilder res = new StringBuilder();
        res.append(type.getSimpleName()).append('#').append(method.getName()).append('(');
        int i = 0;
        for (Class<?> param : method.getParameterTypes()) {
            if (i > 0) {
                res.append(", ");
            }
            final Type generic = method.getGenericParameterTypes()[i];
            if (generic instanceof TypeVariable) {
                // using generic name, because its simpler to search visually in code
                res.append('<').append(((TypeVariable) generic).getName()).append('>');
            } else {
                res.append(param.getSimpleName());
            }
            i++;
        }
        res.append(')');
        return res.toString();
    }
256979
private static String newStringMethodHandle(char[] buf) {
    if (STRING_CONSTRUCTOR_HANDLE != null) {
      try {
        return (String) STRING_CONSTRUCTOR_HANDLE.invokeExact(buf, true);
      } catch (Throwable t) {
        return new String(buf);
      }
    } else {
      return new String(buf);
    }
  }
572940
def write(self, string):
        """"""
        string = string.rstrip()
        if string:  # Don't log empty lines
            self.logger.critical(string)
533576
def safestr(str_):
    '''  '''
    str_ = str_ or ""
    return "".join(x for x in str_ if x.isalnum())
603834
def _to_string(self):
        """"""
        if self.sections:
            start = "/" if self.bound_start else "**/"
            sections = "/**/".join(str(section) for section in self.sections)
            end = "" if self.bound_end else "/**"
        else:
            start = ""
            sections = ""
            end = "" if self.bound_end else "**"
        return "{0}{1}{2}/{3}".format(start, sections, end, str(self.file_pattern))
710972
def string_format(msg, method):
    
    if method == "uppercase":
        return msg.upper()
    elif method == "lowercase":
        return msg.lower()
    elif method == "sentence":
        return msg.capitalize()
    elif method == "formal":
        return string.capwords(msg)
90595
private String resolveString(String s) {

		int pos = s.indexOf(":", 0);

		if (pos == -1)
			return System.getProperty(s);

		String key = s.substring(0, pos);
		String defval = s.substring(pos + 1);

		String val = System.getProperty(key);

		if (val != null)
			return val;
		else
			return defval;
	}
189976
public String getString(String name) {

		Object value = get(name);
		if (value instanceof String ||
			value instanceof Boolean ||
			value instanceof Integer) {
			return value.toString();
		}

		if (value instanceof String[]) {
			String[] list = getStrings(name);
			return StringUtils.join(list, ",");
		}

		return get(name).toString();
	}
1348855
def is_string(val):
    """"""
    try:
        basestring
    except NameError:
        return isinstance(val, str)
    return isinstance(val, basestring)
834145
def read_string(self, string, source='<string>'):
        """"""
        sfile = io.StringIO(string)
        self.read_file(sfile, source)
108365
def fromString(cls, string):
        
        return cls(level=[int(i) for i in string.split("/") if i])
1117729
function(str, methodDec, methodName, method, methodsMap, options){
    var methodValue = getMethodValue(methodDec, methodName, method, methodsMap, options);
    if(str === methodDec) return methodValue;
    return str.replace(methodDec, function(){ return methodValue; });
  }
593344
public static String abbreviate(String _str, int _length) {
        if (_str == null) {
            return null;
        }
        if (_str.length() <= _length) {
            return _str;
        }

        String abbr = _str.substring(0, _length -3) + "...";

        return abbr;
    }