String module

path_overwrite_separators

procedure · 1 overloadSource

Replaces every / and \ in path with separator (the platform's by default), in place. path must be writable, not a string literal.

path_overwrite_separators :: (path: string, separator: u8 = PATH_SEPARATOR)

Parameters

path: string
separator: u8
ExampleOpen in playground ↗
path := copy_string("a/b\\c");
defer free(path);
path_overwrite_separators(path, #char "/");
assert(path == "a/b/c");

See also