String: NPOs find_first_of in C ++ determines what it means

Source: Internet
Author: User

String: NPOs is interpreted as follows:

The logic judgment written yesterday is vague about the meaning of the NPOs returned by FIND. After checking CPP primer, we found the following content and learned that the find method returns a string :: the special value of NPOs indicates that the search does not match. Stick on for memory.

TheString

Class provides six search functions, each named as a variantFind

. The operations all returnString: size_type

Value that is the index of where the match occurred, or a special value namedString: NPOs

If there is no match.String

Class definesNPOs

As a value that is guaranteed to be greater than any valid index.

The string class provides six search functions, each of which is named in different forms of find. All of these operations are returned.
String: value of the size_type type, which is marked as the location where the match occurred. Or, a value named string: NPOs is returned.
It indicates that the search does not match. The string class defines NPOs as a value that must be greater than any valid lower-level value.

 

 

 

For example:

 

String STR = "http://www.my400800.cn
";

Pos = Str. find_first_of ("www ");

If (Pos! = String: NPOs)

{

 

 

}

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.