Function CSTL_u8string_substr

Source
pub unsafe extern "C" fn CSTL_u8string_substr(
    new_instance: *mut CSTL_UTF8StringVal,
    other: CSTL_UTF8StringCRef,
    other_off: usize,
    count: usize,
    alloc: *mut CSTL_Alloc,
) -> bool
Expand description

Initializes the string with the substring at offset other_off in other with the length given by count.

If new_instance == NULL or if other_off is outside of the range [other, other + CSTL_u8string_size(other)] returns false and does nothing, otherwise it returns true.

If new_instance == other the substring operation is performed in-place without de-initializing other.

Remember that re-initializing a different string with a backing memory allocation will leak the old memory allocation.