hello i am able to get index of "@" in c++ but not in qt. i dont know what i have to use to find("@",found+1,q)
#include <iostream> // std::cout
#include <string> // std::string
int main ()
{
std::string str ("msel@-txt/l<seq_name>@#ifndef I_MSEL_@-txt/u<seq_name>@_H");
std::string tag ("@");
// different member versions of find in the same order as above:
std::size_t found = str.find(tag);
if (found!=std::string::npos)
std::cout << "first '@' found at: " << found << '\n';
for (int i = 0; i <= 5; i++)
{ int q =1;
found=str.find("@",found+1,q);
q++;
if (found!=std::string::npos)
std::cout << " '@' found at: " << found << '\n';
}
return 0;
}
#include <iostream> // std::cout
#include <string> // std::string
int main ()
{
std::string str ("msel@-txt/l<seq_name>@#ifndef I_MSEL_@-txt/u<seq_name>@_H");
std::string tag ("@");
// different member versions of find in the same order as above:
std::size_t found = str.find(tag);
if (found!=std::string::npos)
std::cout << "first '@' found at: " << found << '\n';
for (int i = 0; i <= 5; i++)
{ int q =1;
found=str.find("@",found+1,q);
q++;
if (found!=std::string::npos)
std::cout << " '@' found at: " << found << '\n';
}
return 0;
}
To copy to clipboard, switch view to plain text mode
Bookmarks