MCPcopy Create free account
hub / github.com/avast/retdec / removeSuffix

Function removeSuffix

src/utils/string.cpp:1112–1117  ·  view source on GitHub ↗

* @brief Finds the last occurrence of the specified suffix and removes * everything from its start to the end. * * @param[out] n Reference to string. * @param[in] suffix Suffix to find and remove. */

Source from the content-addressed store, hash-verified

1110* @param[in] suffix Suffix to find and remove.
1111*/
1112void removeSuffix(std::string &n, const std::string &suffix) {
1113 std::size_t found = n.rfind(suffix);
1114 if (found != std::string::npos) {
1115 n = n.substr(0, found);
1116 }
1117}
1118
1119/**
1120* @brief Finds the last occurrence of the specified suffix and removes

Callers 2

initFromImageMethod · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68