[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CppReplace
Note that spaces cannot be removed by this function. This is possible in C++ Builder's AnsiReplaceStr.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CppReplace
(C++) std::replace
Function to replace subsections of a std::string by others.int main() { std::string test = "XXX1X23X456X78XX90XX"; std::replace(test.begin(),test.end(),'X',' '); assert(test==" 1 23 456 78 90 "); }
- include <string>
- include <cassert>
Note that spaces cannot be removed by this function. This is possible in C++ Builder's AnsiReplaceStr.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
