C++ 문자열 substr()

(C++ substr()에서 넘어옴)

1 개요[ | ]

C++ substr()
C++ 부분문자열
#include <iostream>
using namespace std;
int main() {
	string str = "abcdefghijk";
	string sub1 = str.substr(4,2);
	cout << sub1 << endl; // ef
	string sub2 = str.substr(6); 
	cout << sub2 << endl; // ghijk
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}