#include <string>
string str;
str.substr(pos, len);
🖥️ 예제 코드
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str = "ABCDEFG";
cout << str.substr() << endl;
cout << str.substr(1) << endl;
cout << str.substr(2, 3) << endl;
cout << str.substr(6, 100) << endl;
}
✔️출력 결과