W7 done done

This commit is contained in:
root
2026-06-15 11:04:16 +00:00
parent 04745f39a8
commit 1743c51e46
33 changed files with 110 additions and 547 deletions
+29
View File
@@ -0,0 +1,29 @@
:sig
StringMap split_kv(String s, char separator = '=', bool trim_whitespace = true, bool uppercase_keys = false)
:params
s : input containing one key/value pair per line
separator : character separating each key from its value
trim_whitespace : trim keys and values when true
uppercase_keys : uppercase keys when true
return value : map of parsed keys and values
:see
>string
split
split_http_headers
:content
Parses simple line-based key/value text into a `StringMap`.
Each non-empty line is split on the first `separator`. Lines without the separator are kept with an empty value.
Example:
```uce
StringMap cfg = split_kv("host = localhost\nport = 8080");
// cfg["host"] == "localhost"
// cfg["port"] == "8080"
```
This is useful for small config files, metadata blocks, and tests that need predictable key/value parsing.