#include <iostream>
#include <string>
using namespace std;
inline bool is_resource_field( const string& fld_name )
{
const string& prefix = "PHONE";
string::size_type n = fld_name.
find_first_of(".");
if ( n == string::npos ) {
return fld_name == prefix;
} else {
return fld_name.substr( 0, n ) == prefix;
}
}
int main()
{
cout << is_resource_field("PHONE") << endl;
cout << is_resource_field("PHONE.01") << endl;
cout << is_resource_field("PHONE#") << endl;
cout << is_resource_field("PHONE#.01") << endl;
}