feat(stdlib): add String_Chars, String_FromBool, fix Fmt and Net

- String.bux: add String_Chars(s, index) for char-at-index access
- String.bux: add String_FromBool(b) conversion
- Fmt.bux: rewrite with correct stdlib imports (was using non-existent names)
- Net.bux: fix String_Len -> bux_strlen (String_Len not imported)
- All lib modules compile successfully
This commit is contained in:
2026-06-07 18:05:04 +03:00
parent bfe87a8acb
commit 04be9eb400
3 changed files with 104 additions and 36 deletions
+10
View File
@@ -161,6 +161,11 @@ func String_Join2(a: String, b: String, sep: String) -> String {
// String find/replace/format
// ---------------------------------------------------------------------------
// String_Chars — return single-character string at index (for iteration)
func String_Chars(s: String, index: uint) -> String {
return bux_str_slice(s, index, 1);
}
func String_Find(haystack: String, needle: String) -> String {
return bux_strstr(haystack, needle);
}
@@ -185,6 +190,11 @@ func String_ToFloat(s: String) -> float64 {
return bux_str_to_float(s);
}
func String_FromBool(b: bool) -> String {
if b { return "true"; }
return "false";
}
func String_FromFloat(f: float64) -> String {
return bux_float_to_string(f);
}