aboutsummaryrefslogtreecommitdiff
path: root/src/util/string.cpp
blob: db6dbe4135b9dde3ab5de32076a3b65bd356a34b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright (c) 2019 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>
#include <utility>

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(std::move(search)), substitute);
}