13
0
livetrax/libs/pbd/strreplace.cc
Paul Davis 8adfb38bd6 fix for #1041, I/O names with colons in them
git-svn-id: svn://localhost/ardour2/trunk@1502 d708f5d6-7413-0410-9779-e7cbd77b26cf
2007-02-23 17:27:06 +00:00

20 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;
}