RSTools 3.1.0
Versatile C++20 utility library
Loading...
Searching...
No Matches
Join.hpp File Reference
#include <format>
#include <initializer_list>
#include <string>
#include <string_view>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Namespaces

namespace  RST
 Root namespace of RSTools.
 
namespace  RST::String
 String helpers: case, trimming, splitting, joining, replacing, parsing and hashing.
 

Functions

Joining

Numbers are formatted with std::format: join({1, 2, 3}, ", ") gives 1, 2, 3.

template<typename Container >
std::string RST::String::join (const Container &parts, std::string_view separator="")
 Joins the elements of parts, strings or numbers, with separator between them.
 
template<typename T >
std::string RST::String::join (std::initializer_list< T > parts, std::string_view separator="")
 Joins a braced list, such as join({4, 5, 6}, "-").
 
std::string RST::String::joinString (const std::vector< std::string > &stringList, char delimiter='\0')
 Joins stringList with a one-character delimiter; the default adds none.