string :: struct { len: s64; ptr: *u8; }
Builtin string storage. string type could represent dynamic and compile time static strings.
// Compile-time string literal my_string :: "This is my string!";
// Dynamic string allocated on heap. // New dynamic string can be created from string literal. my_string :: string_new("This is my string!"); defer string_delete(my_string);
All BL strings are zero terminated, due to better interaction with C APIs, terminator is not counted in string length. However BL API functions does not relly on this.
string_new
string_delete
string_clear
string_append
string_concatenate
string_compare
string_to_f32
string_to_s64
string_split_by_last
string_split_at_index
string_split_by_first
string_insert
string_erase
string_split_by
string_count
string_to_lower
string_to_upper
string_replace_all
string_hash
string_is_null
string_is_empty
string_is_null_or_empty
sprint
Note
String manipulation functions are related only to dynamic strings and cannot be used with string literals since those are constants allocated on stack.
Declared in: string.bl