Escapes a string by replacing characters with escape sequences so that the string can be used when constructing JSON documents. It doesn’t change strings that don’t have anything to escape.

Input

{{ "Have you read 'James & the Giant Peach'?" | json_escape }}

Output

Have you read \'James & the Giant Peach\'?
© 2014-2026 Cyotek Ltd. All Rights Reserved.
Documentation version 1.8 (buildref #147.16253), last modified 2026-04-11. Generated 2026-04-11 11:51 using Cyotek HelpWrite Professional version 6.20.0