public function resolveString($value, array $resolving = array())
    {
        $parts = explode('%', $value);
        $keyOnly = (bool) preg_match('/^%([^%\s]+)%$/', $value);
        $return = $parts[0];

        for ($i = 1, $last = count($parts) - 1; $i <= $last; ++$i) {
            $part = $parts[$i];
            $key = strtolower($part);

            if (0 === $i % 2) {
                $return .= $part;
            } elseif ($last === $i) {
                $return .= '%' . $part;
            } elseif (empty($part) || preg_match('/ /', $part)) {
                $return .= '%' . $part . '%';
            } elseif (isset($resolving[$key])) {
                throw new ParameterCircularReferenceException($key, array_keys($resolving));
            } else {
                $resolved = $this->get($key);

                if (true === $keyOnly) {
                    return $this->resolved ? $resolved : $this->resolveValue($resolved, array_merge($resolving, array($key => true)));
                } elseif (!is_string($resolved) && !is_numeric($resolved)) {
                    throw new RuntimeException('Resolved value is not a string or numbers');
                }

                $resolved = (string) $resolved;
                $return .= $this->resolved ? $resolved : $this->resolveValue($resolved, array_merge($resolving, array($key => true)));
            }
        }

        return $return;
    }