C + + about string summarization (continuous update)

Source: Internet
Author: User

1.find_first_of

Size_type find_first_of (const basic_string &STR, Size_type index = 0);
Size_type find_first_of (const char *STR, Size_type index = 0);
Size_type find_first_of (const char *STR, SIZE_TYPE index, Size_type num);
Size_type find_first_of (char ch, size_type index = 0);

Finds the first character in a string that matches a character in Str and returns its position. Search starts with index and returns if not found String::npos Note: NPOs represents the maximum value of size_t
Finds the first character in a string that matches a character in Str and returns its position. Search starts with index and searches for num characters up to a maximum. If you don't find it, return to String::npos.
Finds the first character in a string that matches CH, and returns its position. The search starts at index.

2.std::string line Line.erase (pos,num); Delete num characters from the POS position in a string

C + + about string summarization (continuous update)

Related Article

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.