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 + countis greater thanthis->size(),countwill be clamped tothis->size() - pos. -
in str
The string to use for replacement.
-
in pos2
The index of the first character in
rhsto use for replacement. -
in count2
The number of characters in
rhsto use for replacement. Ifpos2 + count2is greater thanstr.size(),count2will be clamped tostr.size() - pos2.
Valid Usage
-
posmust not be greater thanthis->size(). -
pos2must not be greater thanstr.size().