"C++ replace()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(다른 사용자 한 명의 중간 판 하나는 보이지 않습니다)
2번째 줄: 2번째 줄:
;C++ replace()
;C++ replace()


<source lang='cpp'>
<syntaxhighlight lang='cpp'>
#include <iostream>
#include <iostream>
#include <algorithm>
#include <algorithm>
12번째 줄: 12번째 줄:
   // hemmo wormd
   // hemmo wormd
}
}
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==
20번째 줄: 20번째 줄:
* [[C++ erase()]] - 문자열에서 문자 삭제
* [[C++ erase()]] - 문자열에서 문자 삭제
* [[C++ assign()]] - 문자열에 내용 할당
* [[C++ assign()]] - 문자열에 내용 할당
* [[C++ regex_replace()]] - 매치되는 부분을 대체


==참고==
==참고==

2020년 11월 2일 (월) 02:47 기준 최신판

1 개요[ | ]

C++ replace()
#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 같이 보기[ | ]

3 참고[ | ]

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