pyxx.strings.str_excludes_chars

pyxx.strings.str_excludes_chars(value: str, prohibited_chars: str) bool

Checks that a string does not contain any of a specified list of prohibited characters

Parameters:
  • value (str) – String whose contents are to be analyzed

  • prohibited_chars (str) – Characters which, if found in value, should result in the function returning False

Returns:

Returns True if none of the characters in prohibited_chars are found in value, and False otherwise

Return type:

bool

Examples

>>> pyxx.strings.str_excludes_chars('abcdefg', 'xyz')
True
>>> pyxx.strings.str_excludes_chars('abcdefg', 'a')
False