C + + string

Source: Internet
Author: User

begin gets the iterator that points to the beginning of the stringend gets the iterator that points to the end of the stringRbegin Gets the iterator that points to the beginning of the reverse stringRend gets the iterator that points to the end of the reverse stringsize to get string sizesLength () is the same function as the size functionmax_size The maximum possible size of a stringcapacity The possible size of a string without reallocating memoryempty to determine if nulloperator[] takes the first few elements, the equivalent of an arrayC_str get C-style const char* stringdata gets the string content addressoperator= assignment operatorReserve SpaceSwap swap functionInsert Insertion CharacterAppend Append characterspush_back Append charactersErase Deleting a stringclear clears all contents of the character containerResize Reallocate Spaceassign is the same as the assignment operatorReplace Replacecopy string to spaceFind lookup, returns the 0-based index numberRFind Reverse LookupFind_first_of finds any character in the containing substring and returns to the first positionfind_first_not_of Find does not contain any characters in a substring, return to the first positionFind_last_of finds any character in the containing substring, returning to the last positionfind_last_not_of Find does not contain any characters in the substring, return to the last positionsubstr (n1,len) gets a substring of length Len starting with a string from N1Compare strings (all relational operators are supported)Compare comparing Stringsoperator+ String Linksoperator+= + = operatoroperator== judge whether equaloperator!= judgment is not equal tooperator< Judging whether it is less thanoperator>> reading a string from the input streamoperator<< String writes to the output stream

Getline reads a line from the input stream

C + + string

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.