"C++ 문자열 substr()"의 두 판 사이의 차이

 
1번째 줄: 1번째 줄:
==개요==
==개요==
;C++ substr()
;C++ substr()
;C++ 부분문자열
<syntaxhighlight lang='cpp'>
<syntaxhighlight lang='cpp'>
#include <iostream>
#include <iostream>

2023년 10월 31일 (화) 20:52 기준 최신판

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 }}