Get string value from the given variable
@param Reference of variable.
@param array     Optional. Possible values.
@return string Value.
336687
public static function getString(&$var, $values = null)
    {
        if (!is_string($var)) {
            $var = '';
        }
        if ($values !== null) {
            return in_array($var, $values, true) ? $var : $values[0];
        }

        return $var;
    }
1297301
@Override
    public String getString(@NonNull String key) {
        if (key == null) { throw new IllegalArgumentException("key cannot be null."); }

        synchronized (lock) {
            final Object obj = getMValue(internalDict, key).asNative(internalDict);
            return obj instanceof String ? (String) obj : null;
        }
    }
951289
@Nullable
	public static <T> T get(T[] array, int index) {
		return array != null && index >= 0 && index < array.length ? array[index] : null;
	}
1098912
private function parseRefAsCommit($reference): ?string
    {
        if (preg_match(self::REGEX_COMMIT, $reference, $matches) !== 1) {
            return null;
        }

        return $matches[0];
    }
916061
private String getStringValue(Object o) {
        if (o instanceof String) {
            return (String) o;
        } else if (o instanceof XmlNodeArray) {
            XmlNodeArray array = (XmlNodeArray) o;
            switch (array.size()) {
                case 0:
                    return null;
                case 1: {
                    return getStringValue(array.get(0));
                }
                default:
                    return getStringValue(array);
            }
        } else if (o instanceof XmlNode) {
            return getStringValue((XmlNode) o);
        } else if (o != null) {
            return o.toString();
        }
        return null;
    }
420112
function checkVariable(variable) {
            if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) {
                variable.references.forEach(checkReference);
            }
        }
855458
public static String getStringValue(@NonNull byte[] value, @IntRange(from = 0) int offset) {
        if (offset > value.length) {
            RxBleLog.w("Passed offset that exceeds the length of the byte array - returning null");
            return null;
        }
        byte[] strBytes = new byte[value.length - offset];
        for (int i = 0; i != (value.length - offset); ++i) {
            strBytes[i] = value[offset + i];
        }
        return new String(strBytes);
    }
723263
public void getValue(String[] valueDestination) {
        if ( valueDestination.length < value.size()) {
          Log.e(TAG, "X3D MFString ArrayIndexOutOfBoundsException");
          Log.e(TAG, "array size " + valueDestination.length + " < MFString value.size = " + size() );
        }
        else {
            for (int i = 0; i < valueDestination.length; i++) {
                valueDestination[i] = get1Value(i);
            }
        }
    }
1132327
public static function getStringRepresentation($value)
    {
        if (is_scalar($value) || $value === null) {
            $stringRepresentation = is_string($value) && !mb_check_encoding($value, 'UTF-8')
                ? 'non UTF-8 string'
                : var_export($value, true);
        } elseif (is_array($value)) {
            $stringRepresentation = 'array';
        } elseif (is_resource($value)) {
            $stringRepresentation = 'resource of type (' . get_resource_type($value) . ')';
        } else {
            $stringRepresentation = 'instance of ' . get_class($value);
        }
        return $stringRepresentation;
    }
1278213
function resolveReferences() {

        for (let key in _variableCollection) {

            let referenceVariables = extractVariables(_variableCollection[key]);

            for (let current = 0; current < referenceVariables.length; current++) {
                if (_.isEmpty(_variableCollection[_.camelCase(referenceVariables[current].variable)]) === false) {
                    _variableCollection[key] = _variableCollection[key].replace(referenceVariables[current].origin, _variableCollection[_.camelCase(referenceVariables[current].variable)]);
                }
            }
        }
    }
156019
public static final String arrayToString(final Object[] array) {
        final StringBuilder builder = new StringBuilder();
        builder.append(ARRAY_START);
        if (array != null && array.length > 0) {
            appendNonEmptyArrayToString(array, builder);
        }
        builder.append(ARRAY_END);
        return builder.toString();
    }
695971
@SuppressWarnings("unchecked")
	public static <T> T get(Object array, int index) {
		if(null == array) {
			return null;
		}
		
		if (index < 0) {
			index += Array.getLength(array);
		}
		try {
			return (T) Array.get(array, index);
		} catch (ArrayIndexOutOfBoundsException e) {
			return null;
		}
	}
293968
public String getString(int offset)
   {
      String result = null;
      byte[] data = getByteArray(offset);
      if (data != null)
      {
         result = new String(data);
      }

      return (result);
   }
338752
public static String getReferenceName( IConditional conditional)
    {
    return
      conditional instanceof IVarDef?
      String.format
      ( "variable=%s",
        ((IVarDef) conditional).getPathName()) :

      conditional instanceof VarBindingDef?
      String.format
      ( "variable=%s, value=%s",
        ((VarBindingDef) conditional).getVarDef().getPathName(),
        String.valueOf( ((VarBindingDef) conditional).getValueDef().getName())) :

      null;
    }
1220400
def p_reference_variable_string_offset(p):
    ''
    p[0] = ast.StringOffset(p[1], p[3], lineno=p.lineno(2))
794137
public function getStringValue($name):?string
    {
        $value = $this->offsetGet($name);
        if (is_null($value)) {
            return null;
        }

        return (string)$value;
    }
380318
@Override
    public String getString(int index) {
        synchronized (lock) {
            final Object obj = getMValue(internalArray, index).asNative(internalArray);
            return obj instanceof String ? (String) obj : null;
        }
    }