mario::konrad
programming / C++ / sailing / nerd stuff
C++ String Join
© 2005 / Mario Konrad

Concatenates all elements from a series (defined by iterators) to a list, represented by a string.

Example:

#include "string_join.hpp"
#include <vector>
#include <iostream>

int main(int argc, char ** argv)
{
    std::vector<std::string> v;
    v.reserve(argc);
    for (int i = 0; i < argc; ++i)
        v.push_back(argv[i]);

    std::cout << utils::join(v.begin(), v.end()) << std::endl;
    return 0;
}