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)
{
}