bitcoin/src/util/string.cpp

17 lines
498 B
C++
Raw Normal View History

// Copyright (c) 2019-2022 The Bitcoin Core developers
// 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
#include <regex>
#include <string>
namespace util {
void ReplaceAll(std::string& in_out, const std::string& search, const std::string& substitute)
2022-05-05 08:28:29 +02:00
{
if (search.empty()) return;
in_out = std::regex_replace(in_out, std::regex(search), substitute);
2022-05-05 08:28:29 +02:00
}
} // namespace util