* @brief Replaces all occurrences of @a what with @a withWhat in @a str and * returns the resulting string. */
| 650 | * returns the resulting string. |
| 651 | */ |
| 652 | std::string replaceCharsWithStrings(const std::string &str, char what, |
| 653 | const std::string &withWhat) { |
| 654 | std::string result; |
| 655 | for (const auto &c : str) { |
| 656 | if (c == what) { |
| 657 | result += withWhat; |
| 658 | } else { |
| 659 | result += c; |
| 660 | } |
| 661 | } |
| 662 | return result; |
| 663 | } |
| 664 | |
| 665 | /** |
| 666 | * @brief Retruns @c true if @a str ends with the suffix @a withWhat, @c false |
no outgoing calls
no test coverage detected