Thanks. Good example. But what about special libraries may be there is some library for string manipulation?
you can design for your own functions..:D
You could use the boost string library. Specifically boost::algorithm::join (http://www.boost.org/doc/libs/1_56_0/doc/html/string_algo/reference.html#header.boost.algorithm.stri...)
For more complete information about compiler optimizations, see our Optimization Notice.