Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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) << '
';
  init = end + 1;
}
std::cout << s.substr(init);
Source by es.stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #recorrer #string
ADD COMMENT
Topic
Name
2+7 =