finding substrings in string objects : string substr « string « C++ Tutorial






#include <iostream>  
  #include <string>  
  using namespace std;  
    
  int main()  {  
     string s1 = "this is a test";  
     int n;  
    
     n = s1.find("test");  
     cout << n << endl;  
    
     return 0;  
  }








15.23.string substr
15.23.1.string member function substr
15.23.2.substr 'to-end-of-string' option
15.23.3.Locating all instances of a substring
15.23.4.Split file name in command line into base name and extension
15.23.5.finding substrings in string objects