From d7182af3992c8e1dc488eeaf689f7c4f61de8048 Mon Sep 17 00:00:00 2001 From: kervala Date: Mon, 21 Nov 2016 20:57:18 +0100 Subject: [PATCH] Changed: New join function to do the opposite work of explode --HG-- branch : develop --- code/nel/include/nel/misc/common.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/code/nel/include/nel/misc/common.h b/code/nel/include/nel/misc/common.h index 0617ad560..c677a01bf 100644 --- a/code/nel/include/nel/misc/common.h +++ b/code/nel/include/nel/misc/common.h @@ -478,6 +478,22 @@ template void explode (const T &src, const T &sep, std::vector &res while(pos != std::string::npos); } +/** Join a string (or ucstring) from a vector of strings with *sep* as separator. If sep can be more than 1 char, in this case, +* we find the entire sep to separator (it s not a set of possible separator) +*/ +template void join(const std::vector& strings, const U& separator, T &res) +{ + res.clear(); + + for (uint i = 0, len = strings.size(); i> with all NeL simple types (except for ucchar and ucstring)