* @brief Replaces non-alphanumeric characters in @a str with @a c. */
| 844 | * @brief Replaces non-alphanumeric characters in @a str with @a c. |
| 845 | */ |
| 846 | std::string replaceNonalnumCharsWith(const std::string &str, std::string::value_type c) { |
| 847 | std::string result; |
| 848 | for(const unsigned char s : str) { |
| 849 | result += isalnum(s) ? s : c; |
| 850 | } |
| 851 | return result; |
| 852 | } |
| 853 | |
| 854 | /** |
| 855 | * @brief Removes all whitespace from the given string. |
no outgoing calls