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
로그인하시면 댓글을 쓸 수 있습니다.