C++ 문자열 substr()

Jmnote (토론 | 기여)님의 2019년 1월 14일 (월) 21:58 판 (새 문서: ==개요== ;C++ substr() <source lang='cpp'> #include <iostream> using namespace std; int main() { string str = "abcdefghijk"; string sub1 = str.substr(4,2); cout << sub1 << endl;...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

C++ substr()
#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 }}