Skip to main content

nova_rt_str_join

Function nova_rt_str_join 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn nova_rt_str_join( sep: *const NovaStr, parts: *const u8, ) -> *mut NovaStr
Expand description

Join every string in parts with sep between each pair: the body of std/strings’ String.join.

One copy of each part and separator, straight into the result’s buffer, sized up front. The Nova-level join it replaces walked every part character by character into a character array.

GC safety: the parts and sep are read after the result’s buffer is allocated, kept alive across it as in nova_rt_str_concat_n.

§Safety

sep must be a valid NovaStr pointer. parts must point to a Nova array laid out as nova_rt_str_concat_n requires. A negative length is treated as zero, as there.