c++ recorrer string
std::string s = "Hola-perro-Cosa";
int init = 0;
int end = 0;
while( end = s.find("-", init), end >= 0 )
{
std::cout << s.substr(init, end - init) << '\n';
init = end + 1;
}
std::cout << s.substr(init);
c++ recorrer string
std::string s = "Hola-perro-Cosa";
int init = 0;
int end = 0;
while( end = s.find("-", init), end >= 0 )
{
std::cout << s.substr(init, end - init) << '\n';
init = end + 1;
}
std::cout << s.substr(init);
c++ recorrer string
std::string Find(std::string const& palabra, std::string const& delim, int & init)
{
int end = palabra.find(delim, prev);
std::string toReturn = palabra.substr(init, end - init);
init = end;
return toReturn;
}
std::string s = "Hola-perro-Cosa";
int init = 0;
std::string string1 = Find(s, "-", init);
std::string string2 = Find(s, "-", init);
std::string string3 = Find(s, "-", init);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us