In C ++, the string class member function find_first_not_of ()

Source: Internet
Author: User
In C ++, the string class member function find_first_not_of ()

Function prototype:

# Include <string>

Size_type find_first_not_of (const string & STR, size_type Index = 0) const;

Size_type find_first_not_of (const char * STR, size_type Index = 0) const;

Size_type find_first_not_of (const char * STR, size_type index, size_type num) const;

Size_type find_first_not_of (char CH, size_type Index = 0) const;

 

 

The find_first_not_of () function is as follows:

1. Return the first character index that appears for the first time in a string that does not match any character of str. Search from index. If all matches, return string: NPOs.

2. start from index to search for the current string. Search for any of the strings that do not match the num character before Str. The first character index that meets the conditions is returned. Otherwise, the string :: NPOs.

3. Return the first index in the current string that does not match the CH character. Search from the index. If no result is returned, return string: NPOs.

 

Note: The string class defines NPOs as greater than any valid value. NPOs =-1 indicates the end of the string index number. Or the index number is invalid. Failed to find

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.