C ++ STL help document-string

Source: Internet
Author: User
String function list
Function Name Description
Begin Obtains the iterator starting with the string.
End Obtains the iterator pointing to the end of the string.
Rbegin Obtain the iterator pointing to the beginning of the reverse string.
Rend Obtains the iterator pointing to the end of the reverse string.
Size Returns the string size.
Length Same as the size function
Max_size Possible maximum size of a string
Capacity Possible string size without re-allocating memory
Empty Judge whether it is empty
OPERATOR [] Returns the number of elements, which is equivalent to an array.
C_str Obtain the C-style const char * string
Data Obtain the string content address
Operator = Value assignment operator
Reserve Reserved space
Swap Exchange Functions
Insert Insert characters
Append Append character
Push_back Append character
Operator + = + = Operator
Erase Delete string
Clear Clear all content in the character container
Resize Re-allocate space
Assign Same as the value assignment operator
Replace Substitution
Copy String to Space
Find Search
Rfind Reverse Lookup
Find_first_of Returns the first position if any character in the substring is found.
Find_first_not_of Returns the first position if any character in the substring is not included.
Find_last_of Searches for any character in the substring and returns the last position
Find_last_not_of Returns the last position if any character in the substring is not included.
Substr Obtain the string
Compare Comparison string
Operator + String Link
Operator = Determine if it is equal
Operator! = Judge whether it is not equal
Operator < Judge whether it is less
Operator> Read a string from the input stream
Operator < String writing to the output stream
Getline Read a row from the input stream

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.