Determines whether the given string consists only of the specified characters.
The string to check.
The list of allowed characters. The string is valid only if every character in str is present in this list.
str
true if str contains only the specified characters or is empty; otherwise, false.
true
false
characters
4.0.0
2025-07-09
Determines whether the given string consists only of the specified characters.