TF++, Miscellaneous classes and modules in C++:

◆ join()

template<template< class > class C>
std::string tfxx::string::join ( const C< std::string > &  v,
const std::string &  delimiter = "" 
)

template #tf::join#:

The following takes any Container of string elements and joins all strings into one single string.

This is the inverse operation to #tf::split#.

Returns
concatenated string
Parameters
vany sequence container containing strings
delimitera string sequence that will put in between the individual strings when concatenating them
Author
Thomas Forbriger
Version
V1.0 (#$Revision: 1.4 $
Date
2009-11-11 12:34:04

#) template to join strings in any sequence container

See also
split
gen_split

Definition at line 71 of file stringfunc.h.

73  {
74  std::string retval;
75  for (typename C<std::string>::const_iterator i=v.begin();
76  i!=v.end(); i++)
77  { retval.append(*i); retval.append(delimiter); }
78  return(retval);
79  }