(→같이 보기) |
Jmnote bot (토론 | 기여) 잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight )) |
||
2번째 줄: | 2번째 줄: | ||
;C++ replace() | ;C++ replace() | ||
< | <syntaxhighlight lang='cpp'> | ||
#include <iostream> | #include <iostream> | ||
#include <algorithm> | #include <algorithm> | ||
12번째 줄: | 12번째 줄: | ||
// hemmo wormd | // hemmo wormd | ||
} | } | ||
</ | </syntaxhighlight> | ||
==같이 보기== | ==같이 보기== |
2020년 11월 2일 (월) 02:47 기준 최신판
1 개요[ | ]
- C++ replace()
C++
Copy
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
string s = "hello world";
replace( s.begin(), s.end(), 'l', 'm');
cout << s << endl;
// hemmo wormd
}
2 같이 보기[ | ]
- C++ insert() - 문자열 내에 삽입
- C++ append() - 문자열 뒤에 추가
- C++ substr() - 부분문자열 생성
- C++ erase() - 문자열에서 문자 삭제
- C++ assign() - 문자열에 내용 할당
- C++ regex_replace() - 매치되는 부분을 대체
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.