Design Pattern Examples
Overview of object-oriented design patterns
replace.cpp File Reference

Implementation of the Replace(const std::string&, const char*, const char*, bool) and Replace(const std::string&, char, char, bool) functions, for replacing narrow character characters and strings in a string. More...

#include <cstring>
#include "replace.h"
#include "strstri.h"
Include dependency graph for replace.cpp:

Go to the source code of this file.

Namespaces

namespace  Helpers
 The namespace containing all the "helper" functions in the C++ code.
 

Functions

std::string Replace (const std::string &s, const char *str1, const char *str2, bool bCaseInsensitive=false)
 Replace all occurrences of narrow string str1 with narrow string str2 in s. If str2 is empty then all matches to str1 are effectively removed from the string.
 
std::string Replace (const std::string &s, char c1, char c2, bool bCaseInsensitive=false)
 Replace all occurrences of narrow character c1 with narrow character c2 in s. If c2 is empty then all matches to str1 are effectively removed from the string.
 

Detailed Description

Implementation of the Replace(const std::string&, const char*, const char*, bool) and Replace(const std::string&, char, char, bool) functions, for replacing narrow character characters and strings in a string.

Definition in file replace.cpp.