Skip to content

Instantly share code, notes, and snippets.

@marvhus
Created August 19, 2023 21:40
Show Gist options
  • Save marvhus/789978f7164be2dab678fed279c157ae to your computer and use it in GitHub Desktop.
Save marvhus/789978f7164be2dab678fed279c157ae to your computer and use it in GitHub Desktop.
Jai u8 to string
u8_to_string :: (c: u8) -> string {
buff: String_Builder;
init_string_builder(*buff);
append(*buff, c);
return builder_to_string(*buff);
}
u8_to_string :: (cs: []u8) -> string {
buff: String_Builder;
init_string_builder(*buff);
for c: cs {
append(*buff, c);
}
return builder_to_string(*buff);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment