Skip to main content

Practice ยท 3 of 3

Flat JSON Extractor

Implement flat-object JSON extraction in Solution: - static String str(String json, String key) โ€” value of "key" when it's a string (unescaped), else null. - static Integer num(String json, String key) โ€” integer value, else null. - static Boolean bool(String json, String key) โ€” true/false, else null. Assume flat objects (no nested braces between the target key and its value) with ", "-style spacing variations. Missing key โ†’ null for all three.

Difficulty: intermediate

Back to lesson: Practice: I/O & Formats Lab