chompPrefix

If str starts with delimiter, then the part of str following delimiter is returned. If str does not start with

delimiter, then it is returned unchanged.

Range
chompPrefix
(
Range
C2
)
(
Range str
,
const(C2)[] delimiter
)

Parameters

str Range

string or forward range of characters

delimiter const(C2)[]

string of characters to be sliced off front of str[]

Return Value

Type: Range

slice of str

Examples

assert(chompPrefix("hello world", "he") == "llo world");
assert(chompPrefix("hello world", "hello w") == "orld");
assert(chompPrefix("hello world", " world") == "hello world");
assert(chompPrefix("", "hello") == "");

Meta