public static member constant
<string>

std::basic_string::npos

static const size_type npos = -1;
Maximum value of size_type
npos is a static member constant value with the greatest possible value for an element of member type size_type.

This value, when used as the value for a len (or sublen) parameter in basic_string's member functions, means "until the end of the string".

As a return value, it is usually used to indicate no matches.

This constant is defined with a value of -1, which because member type size_type is an unsigned integral type, it is the largest possible representable value for this type.