Coerce an object to a string.
@param ctx the context in which this conversion is taking place
@param obj the object to convert
@return the String value of the object
976202
public static final String coerceToString(final ELContext ctx, final Object obj) {
        if (ctx != null) {
        	boolean originalIsPropertyResolved = ctx.isPropertyResolved();
        	try {
        		Object result = ctx.getELResolver().convertToType(ctx, obj, String.class);
        		if (ctx.isPropertyResolved()) {
        			return (String) result;
        		}
        	} finally {
        		ctx.setPropertyResolved(originalIsPropertyResolved);
        	}
        }

        if (obj == null) {
            return "";
        } else if (obj instanceof String) {
            return (String) obj;
        } else if (obj instanceof Enum<?>) {
            return ((Enum<?>) obj).name();
        } else {
            return obj.toString();
        }
    }
802888
function string(obj, fn, ctx) {
  for (var i = 0; i < obj.length; ++i) {
    fn.call(ctx, obj.charAt(i), i);
  }
}
79443
public static ASN1OctetString getInstance(
        Object  obj)
    {
        if (obj == null || obj instanceof ASN1OctetString)
        {
            return (ASN1OctetString)obj;
        }

        if (obj instanceof ASN1TaggedObject)
        {
            return getInstance(((ASN1TaggedObject)obj).getObject());
        }

        if (obj instanceof ASN1Sequence)
        {
            Vector      v = new Vector();
            Enumeration e = ((ASN1Sequence)obj).getObjects();

            while (e.hasMoreElements())
            {
                v.addElement(e.nextElement());
            }

            return new BERConstructedOctetString(v);
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    }
749314
def value_to_string(self, obj):
        """"""
        value = getattr(obj, self.attname)
        return self.get_prep_value(value)
1280428
public static String _char(EvaluationContext ctx, Object number) {
        return "" + (char) Conversions.toInteger(number, ctx);
    }
610389
public static String serialize(Object[] objs)
    {
        StringBuffer buff = new StringBuffer();
        for(int i = 0; i < objs.length; i++)
        {
            if(objs[i] != null)
            {
                buff.append(objs[i].toString());
                if(i != objs.length-1)
                    buff.append(",");
            }
        }
        return buff.toString();
    }
193041
private String getPropertyValueToWrite(Object obj) {

        String value;
        String valueToWrite = null;
        if (obj instanceof List<?>) {
            String[] values = {};
            values = CmsCollectionsGenericWrapper.list(obj).toArray(values);
            // write it
            valueToWrite = "\\\n" + createValueString(values);
        } else {
            value = String.valueOf(obj).trim();
            // escape commas and equals in value
            value = CmsStringUtil.substitute(value, ",", "\\,");
            // value = CmsStringUtil.substitute(value, "=", "\\=");
            // write it
            valueToWrite = value;
        }
        return valueToWrite;
    }
1327372
function(obj)
	{
	    var output = '';
	    
	    for (var i in obj)
	    {
	    	try
	    	{
			    if (obj[i] == null)
			    {
		            output += i + ' = [null]\n';
			    }
			    else if (typeof(obj[i]) == 'function')
			    {
		            output += i + ' => [Function]\n';
		        }
		        else if (typeof(obj[i]) == 'object')
		        {
		        	var ctor = mxUtils.getFunctionName(obj[i].constructor); 
		            output += i + ' => [' + ctor + ']\n';
		        }
		        else
		        {
		            output += i + ' = ' + obj[i] + '\n';
		        }
	    	}
	    	catch (e)
	    	{
	    		output += i + '=' + e.message;
	    	}
	    }
	    
	    return output;
	}
1053675
public String toXml(Object obj, Class<?>... clas) {
		ByteArrayOutputStream out = new ByteArrayOutputStream();
		toXml(obj, out, clas);
		return out.toString();
	}
719033
public String objectToString(Object obj)
    {
        String string = BaseTransport.convertObjectToString(obj);
        return string;
    }
199696
function coerceAll (obj) {
  var type = Array.isArray(obj) ? 'array' : typeof obj;
  var i;
  var n;

  switch (type) {
    case 'string':
      return coerce(obj);
    case 'object':
      if (obj) {
        var props = Object.keys(obj);
        for (i = 0, n = props.length; i < n; i++) {
          var key = props[i];
          obj[key] = coerceAll(obj[key]);
        }
      }
      break;
    case 'array':
      for (i = 0, n = obj.length; i < n; i++) {
        coerceAll(obj[i]);
      }
      break;
  }

  return obj;
}
609917
public static String serialize(Object obj) throws ApiException {
        try {
            if (obj != null)
                    if (obj instanceof String) {
                        // This assumes that we receive json as a string
                        return (String) obj;
                } else {
                        return JsonUtil.getJsonMapper().writeValueAsString(obj);
                }
            else
                return null;
        }
        catch (Exception e) {
            throw new ApiException(500, e.getMessage());
        }
    }
248423
public static Object getObjectProp(Object obj, String property,
                                       Context cx, Scriptable scope)
    {
        Scriptable sobj = toObjectOrNull(cx, obj, scope);
        if (sobj == null) {
            throw undefReadError(obj, property);
        }
        return getObjectProp(sobj, property, cx);
    }
371402
public static function toString($obj)
    {
        return method_exists($obj, '__toString') ? (string) $obj : get_class($obj) . '@' . spl_object_hash($obj);
    }
765645
function objToString(obj, commentFix = false) {
  const comment = commentFix ? '/**/' : ''

  return Object.keys(obj).reduce((acc, k) => {
    let value = obj[k]

    if (k.startsWith('__spread__')) {
      return acc + '${' + value + '};' + comment
    }

    if (typeof value === 'string') {
      if (value[0] === '$') {
        value = '${' + value.substr(1) + '}'
      }
      return acc + camelToKebab(k) + ':' + value + ';' + comment
    } else {
      value = objToString(value)
      let key = k[0] === ':' ? '&' + k : k
      key = key[0] === '`' ? key.substr(1, key.length - 2) : key
      return acc + camelToKebab(key) + '{' + value + '};' + comment
    }
  }, '')
}
749105
function coercePrimitiveToObject(obj) {
  if (isPrimitive(obj)) {
    obj = Object(obj);
  }
  // istanbul ignore next
  if (NO_KEYS_IN_STRING_OBJECTS && isString(obj)) {
    forceStringCoercion(obj);
  }
  return obj;
}
810576
function stringify(obj) {
  if (obj instanceof RegExp) return obj.toString();
  return JSON.stringify(obj, null, 2);
}