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

Function replaceNonalnumCharsWith

src/utils/string.cpp:846–852  ·  view source on GitHub ↗

* @brief Replaces non-alphanumeric characters in @a str with @a c. */

Source from the content-addressed store, hash-verified

844* @brief Replaces non-alphanumeric characters in @a str with @a c.
845*/
846std::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.

Callers 2

setRuleNameMethod · 0.85
TEST_FFunction · 0.85

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.68