Reads a string value from a JSON object by key with escape sequence handling.
Takes json string and key string.
Returns unescaped string via ReturnString, or "" if key not found or quote missing.
JSON
Parameters & Returns
Parameters
jsonString
keyString
Returns
String
Quick Summary
Reads a string value from a JSON object by key with escape sequence handling.
Takes json string and key string.
Returns unescaped string via ReturnString, or "" if key not found or quote missing.
Technical Exegesis...
Reads a string value from a JSON object by key with escape sequence handling. Takes json string and key string. Calls FindKeyPosition helper to search for "\"key\":" pattern. If key not found, returns empty string "". Gets position after colon. Expects opening quote. Skips opening quote, parses until closing quote while handling escape sequences: \\\" -> \", \\\\ -> \\, \\b -> backspace, \\f -> form feed, \\n -> newline, \\r -> carriage return, \\t -> tab. Uses escaped flag to track backslash state.
Reads a string value from a JSON object by key with escape sequence handling. Takes json string and key string. Calls FindKeyPosition helper to search for "\"key\":" pattern. If key not found, returns empty string "". Gets position after colon. Expects opening quote. Skips opening quote, parses until closing quote while handling escape sequences: \\\" -> \", \\\\ -> \\, \\b -> backspace, \\f -> form feed, \\n -> newline, \\r -> carriage return, \\t -> tab. Uses escaped flag to track backslash state. Builds result string character by character. Returns unescaped string via ReturnString, or "" if key not found or quote missing.
This function deserializes string from JSON with proper unescaping. FindKeyPosition searches for exact key match. Escape sequence handling reverses jsonWriteString escaping. Supports standard JSON escape sequences. Returns empty string for missing keys or malformed JSON. Use for reading text properties from JSON documents. Common pattern: name = jsonReadString(json, "name"), message = jsonReadString(json, "message"). Pair with jsonWriteString for round-trip serialization. Handles strings with quotes, newlines, special characters. UTF-8 compatible.