replaces the substrings inside a string This method is 'static' so no external linkage occurs
| 17 | // replaces the substrings inside a string |
| 18 | // This method is 'static' so no external linkage occurs |
| 19 | static std::string replaceAll(std::string str, const std::string& pattern, const std::string& replacement) |
| 20 | { |
| 21 | size_t pos {0}; |
| 22 | while ((pos = str.find(pattern, pos)) != std::string::npos) |
| 23 | { |
| 24 | str.replace(pos, pattern.size(), replacement); |
| 25 | pos += replacement.size(); |
| 26 | } |
| 27 | return str; |
| 28 | } |
| 29 | |
| 30 | namespace OpenMS |
| 31 | { |