Updated test
This commit is contained in:
@@ -418,11 +418,11 @@ namespace lms::core::stringUtils
|
||||
}
|
||||
}
|
||||
|
||||
std::string replaceInString(std::string_view str, const std::string& from, const std::string& to)
|
||||
std::string replaceInString(std::string_view str, std::string_view from, std::string_view to)
|
||||
{
|
||||
std::string res{ str };
|
||||
size_t pos = 0;
|
||||
|
||||
size_t pos = 0;
|
||||
while ((pos = res.find(from, pos)) != std::string::npos)
|
||||
{
|
||||
res.replace(pos, from.length(), to);
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace lms::core::stringUtils
|
||||
template<>
|
||||
[[nodiscard]] std::optional<bool> readAs(std::string_view str);
|
||||
|
||||
[[nodiscard]] std::string replaceInString(std::string_view str, const std::string& from, const std::string& to);
|
||||
[[nodiscard]] std::string replaceInString(std::string_view str, std::string_view from, std::string_view to);
|
||||
|
||||
[[nodiscard]] std::string jsEscape(std::string_view str);
|
||||
[[nodiscard]] std::string jsonEscape(std::string_view str);
|
||||
|
||||
Reference in New Issue
Block a user