mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-14 18:46:34 +01:00
19 lines
381 B
C++
19 lines
381 B
C++
#include <pbd/replace_all.h>
|
|
|
|
int
|
|
replace_all (std::string& str,
|
|
std::string const& target,
|
|
std::string const& replacement)
|
|
{
|
|
std::string::size_type start = str.find (target, 0);
|
|
int cnt = 0;
|
|
|
|
while (start != std::string::npos) {
|
|
str.replace (start, target.size(), replacement);
|
|
start = str.find (target, start+replacement.size());
|
|
++cnt;
|
|
}
|
|
|
|
return cnt;
|
|
}
|
|
|