Task: Escape Special Characters in JSON Strings
Task: Escape Special Characters in JSON Strings: a task in Terminal-Lego-15k (Harbor dataset). When building JSON strings dynamically from user input, special characters (such as quotes, backslashes, newlines, etc.) can break the JSON structure. Your task is to write a program that properly…
The task
When building JSON strings dynamically from user input, special characters (such as quotes, backslashes, newlines, etc.) can break the JSON structure. Your task is to write a program that properly escapes special characters in user-provided string values so that the resulting JSON is valid and parseable.
Part of PrimeIntellect/Terminal-Lego-15k.