kaven-basic - v6.0.0
    Preparing search index...

    Function OnlyContains

    • Determines whether the given string consists only of the specified characters.

      Parameters

      • str: string

        The string to check.

      • ...characters: string[]

        The list of allowed characters. The string is valid only if every character in str is present in this list.

      Returns boolean

      true if str contains only the specified characters or is empty; otherwise, false.

      • The function removes duplicate characters from the characters list before checking.
      • If str is empty, the function returns true.

      4.0.0

      2025-07-09