String is a class and all objects that in string represent sequences of characters.
DeclarationFollowing is the declaration for std::string.
typedef basic_string<char> string;C++11
typedef basic_string<char> string;Member types member type definition value_type char traits_type char_traits<char> allocator_type allocator<char> reference char& const_reference const char& pointer char* const_pointer const char* iterator a random access iterator to char (convertible to const_iterator) const_iterator a random access iterator to const char reverse_iterator reverse_iterator<iterator> const_reverse_iterator reverse_iterator<const_iterator> difference_type ptrdiff_t size_type size_t Member functions Iterators Sr.No. Iterator & description 1 begin
It returns iterator to beginning.
2 endIt returns iterator to end.
3 rbeginIt returns reverse iterator to reverse beginning.
4 rendIt returns reverse iterator to reverse end.
5 cbeginIt returns const_iterator to beginning.
6 cendIt returns a const_iterator pointing to the past-the-end character of the string.
7 crbeginIt returns const_reverse_iterator to reverse beginning.
8 crendIt returns const_reverse_iterator to reverse end.
Capacity Sr.No. Capacity & description 1 sizeIt returns length of string.
2 lengthIt returns length of string.
3 max_sizeIt returns maximum size of string.
4 resizeIt resizes string.
5 capacityIt returns size of allocated storage.
6 reserveIt requests a change in capacity.
7 clearIt clears the string.
8 emptyIt is used to test if string is empty.
9 shrink_to_fitIt is used to shrink to fit.
Capacity Sr.No. Element acce & description 1 operator[]It is used to get character of string.
2 atIt is used to get character in string.
3 backIt is used to access last character.
4 frontIt is used to access first character.
Modifiers Sr.No. Modifier & description 1 operator+=It appends to string.
2 appendIt appends to string.
3 push_backIt appends a character to string.
4 assignIt is used to assign the content to string.
5 insertIt is used to inset the value to string.
6 eraseIt is used to erase characters from string.
7 replaceIt is used to replace portion of string.
8 swapIt is used to swap string values.
9 pop_backIt is used to delete last character.
String operations Sr.No. String operation & description 1 c_strIt is used to get C string equivalent.
2 dataIt is used to get string data.
3 get_allocatorIt is used to get an allocator.
4 copyIt is used to copy sequence of characters from string.
5 findIt is used to find content in string.
6 rfindIt is used to find last occurrence of content in string.
7 find_first_ofIt is used to find character in string.
8 find_last_ofIt is used to find character in string from the end.
9 find_first_not_ofIt is used to find absence of character in string.
10 find_last_not_ofIt is used to find non-matching character in string from the end.
11 substrIt is used to generate substring.
12 compareIt is used to compare strings.
Numeric Conversions Sr.No. Function & description 1 stoiIt is used to convert a string to an integer (int).
2 stolIt is used to convert a string to a long integer.
3 stollIt is used to convert a string to a long long integer.
4 stoulIt is used to convert a string to an unsigned long integer.
5 stoullIt is used to convert a string to an unsigned long long integer.
6 stofIt is used to convert a string to a floating point number.
7 stodIt is used to convert a string to a double floating point number.
8 stoldIt is used to convert a string into a long double value.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4