Get Substrings - C++ STL

C++ examples for STL:string

Description

Get Substrings

Demo Code

#include <iostream>
#include <string>

int main(int argc, const char* argv[]) {
    std::string string1("this is a test this is a test.");

    std::cout << string1.substr(7, 5) << std::endl;

    return 0;/*from   w  w w . j a  va 2  s .c  o  m*/
}

Result


Related Tutorials