replace overloads

Synopses

Declared in <folly/FBString.h>

Replaces an iterator range with the content of another string.

Replaces an iterator range with a null‐terminated array.

Replaces a range of characters with a null‐terminated array.

Replaces a range of characters with the content of another string.

Replaces an iterator range with characters, a count, or a range.

template<
    class T1,
    class T2>
basic_fbstring&
replace(
    iterator i1,
    iterator i2,
    T1 first_or_n_or_s,
    T2 last_or_c_or_n);

Replaces a range of characters with repeated characters or a buffer.

template<
    class StrOrLength,
    class NumOrChar>
basic_fbstring&
replace(
    size_type pos,
    size_type n1,
    StrOrLength s_or_n2,
    NumOrChar n_or_c);

Replaces a range of characters with a substring of another string.

Return Value

A reference to this string.

Parameters

Name

Description

i1

Iterator to the first character of the range to replace.

i2

Iterator past the last character of the range to replace.

str

The replacement string.

s

Pointer to the null‐terminated replacement characters.

pos

The starting position of the range to replace.

n1

The maximum number of characters to replace.

pos1

The starting position of the range to replace.

first_or_n_or_s

The replacement buffer, count, or first iterator.

last_or_c_or_n

The buffer length, character, or last iterator.

s_or_n2

Either the replacement buffer or a repeat count.

n_or_c

Either the buffer length or the character to repeat.

pos2

The starting position within str.

n2

The maximum number of characters from str to use.

Created with MrDocs