@param string $string

@return bool
12203
public function endsWith(string $string) : bool
    {
        return substr($this->path, - strlen($string)) === $string;
    }
524472
public function equalsIgnoreCase($string): bool
    {
        try {
            Assert::typeOf(['string', __CLASS__], $string);
        } catch (InvalidArgumentException|TypeError $t) {
            return false;
        }

        return strcmp(
            mb_strtolower($this->data, $this->encoding),
            mb_strtolower((string) $string, $this->encoding)
        ) === 0;
    }
200853
private function isValidText($string)
    {
        $search = array(" ", "　", "\n", "\r", "\t");
        $replace = array("", "", "", "", "");
        return str_replace($search, $replace, $string) !== '';
    }
802
protected function _strlen($string)
    {
        $encoding = function_exists('mb_detect_encoding') ? mb_detect_encoding($string) : false;
        return $encoding ? mb_strlen($string, $encoding) : strlen($string);
    }
668763
public static function containsValidJSON($string)
	{
		try
		{
			$result = json_decode($string);
		}
		catch(\Exception $e)
		{}
		
		if(self::getJSONError() === NULL)
			return true;
		else
			return false;
	}
865299
public static function validate($string)
    {
        try {
            if (is_numeric($string) && (int)$string == $string) {
                $date = new DateTime('@' . $string);
            } else {
                $date = self::parse($string);
            }
        } catch (Exception $ex) {
            return false;
        }

        // String is empty or not a valid date
        if (empty($string) || $date === false) {
            return false;

            // String is a valid date
        } else {
            return true;
        }
    }
545595
public static function strToBool($string)
    {
        if(is_bool($string))
            return $string;

        if (in_array(strtolower((string)$string), array('1', 'true', 'on', '+', 'yes', 'y')))
            return true;
        elseif (in_array(strtolower((string)$string), array('', '0','false', 'off', '-', 'no', 'n')))
            return false;

        return false;
    }
851546
public static function isJson($string)
    {
        if (strpos($string, "{") !== false) {
            json_decode($string);
            return (json_last_error() == JSON_ERROR_NONE);
        } else {
            return false;
        }
    }
1282961
private function hasAttachedMethod($string)
    {
        return 1 === substr_count($string, self::M_SEPARATOR) && 0 !== strpos($string, self::M_SEPARATOR);
    }
95373
public static function toBool($string)
    {
        if (null === $string) {
            return null;
        }

        return in_array(strtolower($string), self::$booleanTrue);
    }
921914
public function isPattern(string $string): bool
    {
        return strpos($string, '*') !== false || strpos($string, '|') !== false;
    }
823040
public function matches(string $string) : bool
    {
        $matches = [];

        return (bool)call_user_func_array(
            $this->_method,
            [
                sprintf("/%s/%s", $this->_expr, $this->_flags),
                $string,
                &$matches,
                $this->_pregMatchFlags ?: null,
            ]
        );
    }
337235
public static function exists($string)
    {
        $instance = self::getInstance();
        foreach ($instance->getModules() as $module) {
            if ($module->title === $string) {
                return true;
            }
        }
        return false;
    }
89605
protected function isSerialized($string)
    {
        // if it isn't a string, it isn't serialized
        if ( ! is_string($string)) {
            return false;
        }
        $string = trim($string);
        if ('N;' == $string) {
            return true;
        }
        if ( ! preg_match('/^([adObis]):/', $string, $matches)) {
            return false;
        }
        switch ($matches[ 1 ]) {
            case 'a' :
            case 'O' :
            case 's' :
                if (preg_match("/^{$matches[1]}:[0-9]+:.*[;}]\$/s", $string)) {
                    return true;
                }
                break;
            case 'b' :
            case 'i' :
            case 'd' :
                if (preg_match("/^{$matches[1]}:[0-9.E-]+;\$/", $string)) {
                    return true;
                }
                break;
        }

        return false;
    }
1339199
public function parseString($string)
    {
        $string = (string) $string;
        $string = preg_replace_callback("/\\$\{(.*?)\}/",
            function ($k) {
                return $this->get($k[1]);
            }, $string);

        return $string;
    }
1141305
protected function translate($string)
    {
        $translated = $this->app['translator']->get($string);

        return is_string($translated) ? $translated : $string;
    }
593875
public function match($string)
    {
        return $this->string === $string || in_array($string, $this->aliases, true);
    }