mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-03-11 01:26:10 +01:00
There are no changes to behavior. Changes in this commit are all additions, and are easiest to review using "git diff -U0 --word-diff-regex=." options. Motivation for this change is to keep util functions with really generic names like "Split" and "Join" out of the global namespace so it is easier to see where these functions are defined, and so they don't interfere with function overloading, especially since the util library is a dependency of the kernel library and intended to be used with external code.
16 lines
498 B
C++
16 lines
498 B
C++
// 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>
|
|
|
|
#include <regex>
|
|
#include <string>
|
|
|
|
namespace util {
|
|
void ReplaceAll(std::string& in_out, const std::string& search, const std::string& substitute)
|
|
{
|
|
if (search.empty()) return;
|
|
in_out = std::regex_replace(in_out, std::regex(search), substitute);
|
|
}
|
|
} // namespace util
|