V
varsha.gadekar
what is the easy way to check if the given string is substring of other
string only using c++?
string only using c++?
what is the easy way to check if the given string is substring of other
string only using c++?
what is the easy way to check if the given string is substring of other
string only using c++?
VJ said:You can use substr function:
benben said:Are you serious?
std::string s("Some text is here");
std::string::size_type pos = s.find("text");
if (pos == std::string::npos)
{
// Not found
}
else
{
// Substring is on index pos
}
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.