Skip to content

isPrintable

isPrintable(string) → boolean · String

Returns true if the string contains only printable characters (letters, digits, punctuation, spaces).

  • string (required): string to test
utlx
isPrintable("Hello, World!")             // true
isPrintable("Hello\x00World")            // false (contains null byte)
{
  safe: isPrintable($input.userInput)
}

Released under AGPL-3.0.