fork download
  1. #include <string>
  2.  
  3. void f(const std::string& source)
  4. {
  5. size_t i = source.find_first_of('|');
  6. if (i == std::string::npos)
  7. {
  8. return;
  9. }
  10.  
  11. size_t j = source.find_first_of('|', i + 1);
  12. if (i == std::string::npos)
  13. {
  14. return;
  15. }
  16. std::string id = source.substr(i + 1, j - i - 1);
  17. }
  18.  
  19. int main()
  20. {
  21. f("xxx");
  22. }
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
Standard output is empty