first, last Input iterators to the initial and final positions in a range. s Pointer to an array of characters (such as a c-string). Sublen Length of the substring to be copied (if the string is shorter, as many characters as possible are copied).Ī value of basic_string::npos indicates all characters until the end of str. Note: The first character in str is denoted by a value of 0 (not 1).
If this is greater than str's length, it throws out_of_range. Subpos Position of the first character in str that is copied to the object as a substring. Parameters str Another basic_string object of the same type (with the same class template arguments charT, traits and Alloc), whose value is either copied or moved. Str is left in an unspecified but valid state. (7) initializer list Copies each of the characters in il, in the same order. (6) range Copies the sequence of characters in the range [first,last), in the same order. (5) fill Replaces the current value by n consecutive copies of character c. (4) buffer Copies the first n characters from the array of characters pointed by s. The length is determined by calling traits_type::length(s). (3) c-string Copies the null-terminated character sequence (C-string) pointed by s.
(2) substring Copies the portion of str that begins at the character position subpos and spans sublen characters (or until the end of str, if either str is too short or if sublen is basic_string::npos). Assigns a new value to the string, replacing its current contents.