moved replace_str to util

This commit is contained in:
Zeno Rogue committed 2021-02-07 22:55:10 +01:00
1 parent a3574a2c13
commit dc20dfe648
2 files changed
+6 -5

No files matched your search

+6
View File
@@ -690,6 +690,12 @@ bignum::bignum(ld d) {
while(n >= 0) { digits[n] = int(d); d -= digits[n]; d *= BASE; n--; }
}
/** in s, replace occurences of a with b */
EX void replace_str(string& s, string a, string b) {
while(s.find(a) != string::npos)
s.replace(s.find(a), isize(a), b);
}
#if CAP_ZLIB
/* compression/decompression */