See if `char1` or `char2` (integer codes for characters) is contained in `string`
778464
function containsCharacter2(string, char1, char2) {
  for (var i = 0, len = string.length; i < len; ++i) {
    var ch = string.charCodeAt(i);
    if (ch === char1 || ch === char2) return true;
  }
  return false;
}
976422
def detect_encoding(string):
    
    assert isinstance(string, bytes)
    try:
        detected = chardet.detect(string)
        if detected:
            return detected.get('encoding') or 'utf-8'
    except Exception as e:
        pass
    return 'utf-8'
107932
public static boolean isAlpha(String in) {
		char c = 0;
		for (int i = in.length(); i > 0; i--) {
			c = in.charAt(i - 1);
			if (!Character.isLetter(c)) {
				return false;
			}
		}
		return true;
	}
765073
function(str,pid){
		var matches = str.match(/!?[a-z0-9]+/g), isdisp = true;
		if(!!matches){
			isdisp = false;
			for(var i=0;i<matches.length;i++){
				if(matches[i].charAt(0)!=="!"){ if(matches[i]===pid){ isdisp = true;}}
				else                          { isdisp = (matches[i].substr(1)!==pid);}
			}
		}
		return isdisp;
	}
552627
def is_separator(self, char):
        
        if len(char) > 1:
            raise TypeError("Expected a char.")
        if char in self.separators:
            return True
        return False
1125212
def _char2int(char):
    
    if char.isdigit():
        return int(float(char))
    if char.isupper():
        return int(char, 36)
    else:
        return 26 + int(char, 36)
170699
def chars(string: any) -> str:
        """"""
        return ''.join([c if c.isalpha() else '' for c in str(string)])
313012
private boolean charsMatch(char[] chars, int pos1, int len1, int pos2, int len2) {
        if (len1 != len2) {
            return false;
        }
        if (pos1 + len1 > chars.length || pos2 + len2 > chars.length) {
            return false;
        }
        for (int i = 0; i < len1; i++) {
            if (chars[pos1 + i] != chars[pos2 + i]) {
                return false;
            }
        }
        return true;
    }
881910
def select_regexp_char(char):
    
    regexp = '{}'.format(char)

    if not isinstance(char, str) and not isinstance(char, int):
        regexp = ''

    if isinstance(char, str) and not char.isalpha() and not char.isdigit():
        regexp = r"\{}".format(char)

    return regexp
23858
function isPalindrome(s) {
    var total = s.length;
    if(total < 2) return true;
    if(s.charAt(0) !== s.charAt(total - 1)) return false;

    return isPalindrome(s.substr(1, total - 2));
}
1033981
def _IsIdentifier(cls, string):
    
    return (
        string and not string[0].isdigit() and
        all(character.isalnum() or character == '_' for character in string))
1069035
private int find(UTF8String str, int start) {
    assert (str.numBytes > 0);
    while (start <= numBytes - str.numBytes) {
      if (ByteArrayMethods.arrayEquals(base, offset + start, str.base, str.offset, str.numBytes)) {
        return start;
      }
      start += 1;
    }
    return -1;
  }
585094
def any_in_string(l, s):
    
    return any([i in l for i in l if i in s])
271135
public static Character detectChar(String string, CharPredicate predicate)
    {
        int size = string.length();
        for (int i = 0; i < size; i++)
        {
            char character = string.charAt(i);
            if (predicate.accept(character))
            {
                return character;
            }
        }
        return null;
    }
1102940
protected static boolean isNumeric(String s)
    {
        for (char c : s.toCharArray())
        {
            if (!Character.isDigit(c))
                return false;
        }
        return true;
    }
1352917
def is_equal(self, string1, string2):
        '''  '''
        return string1.lower().strip() == string2.lower().strip()
552145
static boolean hasFunkyChars(String s) {
        int length = s.length();

        if (length == 0)
            return false;

        for (int i = 0; i < length; ++i) {
            char c = s.charAt(i);

            if (Character.isLetterOrDigit(c) || c == '-' || c == '_')
                continue;
            else
                return true;
        }
        return false;
    }