Text_Buffer module

copy_range

procedureextensionexperimentalsince 0.31.0Source

A copy of the bytes from start up to end, made with allocator.

Example↗
buffer: Text_Buffer;
defer free_buffer(*buffer);
set_text(*buffer, "hello world");
word := copy_range(*buffer, 0, 5, temp);
insert(*buffer, 0, ">> ");
assert(word == "hello");
copy_range :: (
    buffer: *Text_Buffer,
    start: int,
    end: int,
    allocator: Allocator
) -> string

Parameters

buffer: *Text_Buffer
start: int
end: int
allocator: Allocator

Returns

string

See also