2022-12-24 23:49:50 +00:00
|
|
|
// Copyright (c) 2019-2022 The Bitcoin Core developers
|
2019-08-20 14:51:43 -04:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#include <util/string.h>
|
2022-05-05 08:28:29 +02:00
|
|
|
|
2022-08-08 11:44:27 +01:00
|
|
|
#include <regex>
|
2022-06-09 16:26:55 +01:00
|
|
|
#include <string>
|
|
|
|
|
2023-12-06 15:13:39 -05:00
|
|
|
namespace util {
|
2022-08-08 11:44:27 +01:00
|
|
|
void ReplaceAll(std::string& in_out, const std::string& search, const std::string& substitute)
|
2022-05-05 08:28:29 +02:00
|
|
|
{
|
2022-08-08 11:44:27 +01:00
|
|
|
if (search.empty()) return;
|
2022-08-19 11:38:56 +02:00
|
|
|
in_out = std::regex_replace(in_out, std::regex(search), substitute);
|
2022-05-05 08:28:29 +02:00
|
|
|
}
|
2023-12-06 15:13:39 -05:00
|
|
|
} // namespace util
|