Return true if the given string contains only letters, digits, and underscores.

@param   string  String to be tested.
@return          True if the string is not null, not empty, and contains only
letters, digits, and underscores.
772672
public static boolean allAlphaNumUnderscore(String string) {
        if (string == null || string.length() == 0) {
            return false;
        }
        for (int index = 0; index < string.length(); index++) {
            char ch = string.charAt(index);
            if (!isLetter(ch) && !isDigit(ch) && ch != '_') {
                return false;
            }
        }
        return true;
    }
286545
public static function isEmpty($string)
    {
        if (is_array($string) || is_object($string)) {
            return empty($string);
        }

        $string = (string) $string;

        return !(bool) strlen($string);
    }
1120505
public static boolean isVariable(String s) {
        if (s == null ||
                s.length() < 3 ||
                !s.startsWith("$") ||
                !Character.isLetter(s.charAt(1))) {
            return false;
        }

        // check that the rest of the string is comprised of letters and digits only:
        for (int i = 2; i < s.length(); i++) {
            char c = s.charAt(i);
            if (!Character.isLetterOrDigit(c)) {
                return false;
            }
        }

        return true;
    }
835991
public static function likeEmpty(?string $string = null): bool
    {
        return $string === null || $string === '' || $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,
            ]
        );
    }
1355863
public static boolean isDelimiter(String str)
    {
        if (str != null && ("-".equals(str) || "－".equals(str)))
            return true;
        else
            return false;
    }
718254
@Override
	public boolean contains(String str) {
		int[] positions = createHashes(str, hashFunctionNumber);
		for (int i : positions) {
			int position = Math.abs(i % bitSetSize);
			if (!bitSet.get(position)) {
				return false;
			}
		}
		return true;
	}
109941
public static boolean isEmail(final String string) {
        if (StringUtils.isBlank(string)) {
            return false;
        }

        if (MAX_EMAIL_LENGTH < string.length()) {
            return false;
        }

        final String[] parts = string.split("@");

        if (2 != parts.length) {
            return false;
        }

        final String local = parts[0];

        if (MAX_EMAIL_LENGTH_LOCAL < local.length()) {
            return false;
        }

        final String domain = parts[1];

        if (MAX_EMAIL_LENGTH_DOMAIN < domain.length()) {
            return false;
        }

        return EMAIL_PATTERN.matcher(string).matches();
    }
243908
public static function isPair($string)
    {
        $pair = explode("\x20", $string);

        if (count($pair) == 2) {
            if (self::isIdentifier(self::toLowerTrim($pair[0])) && self::isIdentifier(self::toLowerTrim($pair[1]))) {
                return true;
            }
        }

        return false;
    }
516062
public static boolean isOnlyLowerCase(String string) {
        boolean result = isNotEmpty(string);
        int idx = 0;
        int len = string.length();
        while (result) {
            if (idx >= len) {
                break;
            }
            result = isLowerCase(string.charAt(idx));
            idx++;
        }
        return result;
    }
546201
public void contains(CharSequence string) {
    checkNotNull(string);
    if (actual() == null) {
      failWithActual("expected a string that contains", string);
    } else if (!actual().contains(string)) {
      failWithActual("expected to contain", string);
    }
  }
1165604
public static function isEmpty($string)
    {
        if (!self::isValid($string) &&
            null !== $string
        ) {
            return false;
        }

        return ($string === null || $string === '');
    }
687108
public static function isStreetNumber($string) {
        static $pattern = '/^[0-9A-Za-z-\/]+$/';
        return is_string($string) && strlen($string) && preg_match($pattern, strtolower($string));
    }
902719
public static boolean isEmpty(String str) {
        if (str == null)
            return true;
        if ("".equals(str.trim()))
            return true;
        return str.isEmpty();
    }
435583
public static function isPoint($string)
    {
        if (gettype($string) === 'string') {
            $parts = explode("\x20", $string);
            if (count($parts) == 2) {
                if (self::isInteger($parts[0]) && self::isInteger($parts[1])) {
                    return true;
                }
            }
        }

        return false;
    }
1081948
public boolean hasIgnoringCase(String value)
    {
        if (values.isEmpty())
        {
            return false;
        }
        value = value.toLowerCase();
        for (String v : values)
        {
            if (v.toLowerCase().equals(value))
            {
                return true;
            }
        }
        return false;
    }
987563
public static function isUnderscoreName($string)
    {
        // If there are space in the name, it can't be valid.
        if (strpos($string, ' ') !== false) {
            return false;
        }

        if ($string !== strtolower($string)) {
            return false;
        }

        $validName = true;
        $nameBits  = explode('_', $string);

        foreach ($nameBits as $bit) {
            if ($bit === '') {
                continue;
            }

            if ($bit{0} !== strtolower($bit{0})) {
                $validName = false;
                break;
            }
        }

        return $validName;

    }