aslf010990's blog

By aslf010990, 9 years ago, In English

Hello , I have a little doubt : Is there in c ++ the indexOf method ?, greetings

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it +4 Vote: I do not like it
     string s = "abacaba";
     cout << s.find("aba")    << "\n"; // 0
     cout << s.find("caba")   << "\n"; // 3
     cout << s.find("x")      << "\n"; // string::npos
     cout << s.find("aba", 2) << "\n"; // 4
  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    ok , I 'm working with Vector, is it done in the same way ?, greetings