Luna::BasicString::replace
void replace(usize pos, usize count, const BasicString &str, usize pos2, usize count2=npos)
Replaces characters in range [pos
, pos + count
) with a substring [pos2
, pos2 + count2
) of str
.
Parameters
-
in pos
The index of the first character to replace.
-
in count
The number of characters to replace. If
pos + count
is greater thanthis->size()
,count
will be clamped tothis->size() - pos
. -
in str
The string to use for replacement.
-
in pos2
The index of the first character in
rhs
to use for replacement. -
in count2
The number of characters in
rhs
to use for replacement. Ifpos2 + count2
is greater thanstr.size()
,count2
will be clamped tostr.size() - pos2
.
Valid Usage
-
pos
must not be greater thanthis->size()
. -
pos2
must not be greater thanstr.size()
.