Use boost::algorithm::join(..)
:
#include <boost/algorithm/string/join.hpp>
...
std::string joinedString = boost::algorithm::join(elems, delim);
See also this question.
More Related Contents:
- std::string formatting like sprintf
- Parsing a comma-delimited std::string [duplicate]
- Legality of COW std::string implementation in C++11
- Remove spaces from std::string in C++
- Why should one not derive from c++ std string class?
- char* vs std::string in c++ [closed]
- std::string::c_str() and temporaries
- Case insensitive std::string.find()
- Why does C++ allow an integer to be assigned to a string?
- Error: invalid operands of types ‘const char [35]’ and ‘const char [2]’ to binary ‘operator+’
- Is it reasonable to use std::basic_string as a contiguous buffer when targeting C++03?
- Why can’t I write to a string literal while I *can* write to a string object?
- How to get the number of characters in a std::string?
- std::strings’s capacity(), reserve() & resize() functions
- Why don’t the std::fstream classes take a std::string?
- I want to convert std::string into a const wchar_t *
- How to read and write a STL C++ string?
- Is std::string size() a O(1) operation?
- initializing std::string from char* without copy
- std::string length() and size() member functions
- Why doesn’t std::string provide implicit conversion to char*?
- Padding stl strings in C++
- How can I make the map::find operation case insensitive?
- How to convert a string of hex values to a string?
- Why are string literals const?
- What is the proper function for comparing two C-style strings?
- How to pretty-print STL containers in GDB?
- Counting the number of occurrences of a string within a string
- How can i estimate memory usage of std::map?
- Fastest way to Convert String to Binary?