X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fstrings%2Futils.cpp;h=80e59f07a6cb5802eb741aa870a0498e2308fea0;hp=416188ec3d574e71caaecf2fa4353eaff8f67564;hb=9955efca718d8be72b63c7c2182ca59e7b9d0935;hpb=9c8bb278a26c0c4356d6ee5e66d3f34c70521fb8 diff --git a/source/strings/utils.cpp b/source/strings/utils.cpp index 416188e..80e59f0 100644 --- a/source/strings/utils.cpp +++ b/source/strings/utils.cpp @@ -130,6 +130,20 @@ string strip(const string &s) return result; } +string &append(string &str, const string &sep, const string &other) +{ + if(!str.empty() && !other.empty()) + str += sep; + str += other; + return str; +} + +string join(const string &str1, const string &sep, const string &str2) +{ + string result = str1; + return append(result, sep, str2); +} + string c_unescape(const std::string &str) { bool escape = false;