* @brief Finds the last occurrence of the specified suffix and removes * everything from its start to the end. * @param[in] n Source string. * @param[in] suffix Suffix to find and remove. * * @return Copy of source string without suffix address. */
| 1126 | * @return Copy of source string without suffix address. |
| 1127 | */ |
| 1128 | std::string removeSuffixRet(const std::string &n, const std::string &suffix) { |
| 1129 | std::string ret = n; |
| 1130 | std::size_t found = ret.rfind(suffix); |
| 1131 | if (found != std::string::npos) { |
| 1132 | ret = ret.substr(0, found); |
| 1133 | } |
| 1134 | return ret; |
| 1135 | } |
| 1136 | |
| 1137 | /** |
| 1138 | * @brief Replaces all special symbols by their normalized equivalent. |