chore: remove unused string::findReplaceAll

This commit is contained in:
sithlord48
2025-03-24 21:07:31 -04:00
committed by Nick Bolton
parent 541e30f406
commit 55c611f754
3 changed files with 0 additions and 26 deletions

View File

@ -147,15 +147,6 @@ std::string sprintf(const char *fmt, ...)
return result;
}
void findReplaceAll(std::string &subject, const std::string &find, const std::string &replace)
{
size_t pos = 0;
while ((pos = subject.find(find, pos)) != std::string::npos) {
subject.replace(pos, find.length(), replace);
pos += replace.length();
}
}
std::string toHex(const std::string &subject, int width, const char fill)
{
std::stringstream ss;

View File

@ -46,12 +46,6 @@ Equivalent to sprintf() except the result is returned as a String.
*/
std::string sprintf(const char *fmt, ...);
//! Find and replace all
/*!
Finds \c find inside \c subject and replaces it with \c replace
*/
void findReplaceAll(std::string &subject, const std::string &find, const std::string &replace);
//! Convert into hexdecimal
/*!
Convert each character in \c subject into hexdecimal form with \c width

View File

@ -22,17 +22,6 @@ TEST(StringTests, format_formatWithArguments_formatedString)
EXPECT_EQ("%answer=42", result);
}
TEST(StringTests, findReplaceAll_inputString_replacedString)
{
std::string subject = "foobar";
std::string find = "bar";
std::string replace = "baz";
string::findReplaceAll(subject, find, replace);
EXPECT_EQ("foobaz", subject);
}
TEST(StringTests, sprintf_formatWithArgument_formatedString)
{
const char *format = "%s=%d";