C++/문자열 교체 헬퍼 std:string Replace Edit Diff Refresh Backlink Random Search History Help Setting Hide Show inline int Replace_Helper(string* source, const string& replaceString, const string& fmt) { std::string::size_type offset = 0; offset = source->find(replaceString, offset); if (offset != std::string::npos) { source->replace(offset, replaceString.length(), fmt); return 1; } return 0; } int Replace(string* source, const string& replaceString, const string& fmt) { int seq = 0; while (Replace_Helper(source, replaceString, fmt)) ++seq; return seq; } ... string fmt(""); Replace(&str, "▶", fmt); 교묘했습니다 ▶ 인터뷰 신 ↓ 교묘했습니다 인터뷰 신 C++ Helper replace string 함수 이 글에는 0 개의 댓글이 있습니다. Please enable JavaScript to view the comments powered by Disqus. comments powered by Disqus