Iterates over a given str and replaces all instance of substring oldStr with newStr
| 107 | /// Iterates over a given str and replaces all instance of substring oldStr with newStr |
| 108 | /// |
| 109 | inline void StringReplaceAll(std::string& str, |
| 110 | const std::string& oldStr, |
| 111 | const std::string& newStr) |
| 112 | { |
| 113 | std::string::size_type pos = 0u; |
| 114 | while ((pos = str.find(oldStr, pos)) != std::string::npos) |
| 115 | { |
| 116 | str.replace(pos, oldStr.length(), newStr); |
| 117 | pos += newStr.length(); |
| 118 | } |
| 119 | } |
| 120 | |
| 121 | /// |
| 122 | /// Converts a string to bool. |