14inline auto split(std::string_view full, std::string_view
tok) {
17 return std::make_tuple(full, std::string_view{});
19 std::string_view key = full.substr(0,
tok_pos);
21 return std::make_tuple(key,
rem);
29 return std::make_tuple(std::string_view{}, full);
31 std::string_view key = full.substr(0,
tok_pos);
33 return std::make_tuple(key,
rem);
38 std::string_view
sep =
", ";
46 if (std::ranges::empty(
strings))
47 return std::string(
opt.empty);
51 return std::move(
acc);
53 auto begin = std::ranges::begin(
strings);
54 auto end = std::ranges::end(
strings);
55 using std::ranges::next;
56 std::string
first{*begin};
62 std::string_view
sep =
", ";
74 if (std::ranges::empty(
strings))
75 return std::string(
opt.empty);
81 return std::move(
acc);
83 auto begin = std::ranges::begin(
strings);
84 auto end = std::ranges::end(
strings);
85 std::string
first{*begin};
87 using std::ranges::next;
89 result +=
opt.quote_right;
95 auto cmp = [](
const auto &
a,
const auto &b) {
96 auto toupper = [](
unsigned char c) {
return std::toupper(c); };
97 return std::ranges::lexicographical_compare(
99 std::views::transform(b,
toupper));
std::string join_quote(std::ranges::input_range auto strings, join_quote_opt opt={})
Join the list of strings into a single string, using the separator given by opt.
auto split_second(std::string_view full, std::string_view tok)
Split the string s on the first occurrence of tok.
std::string_view quote_right
std::string_view quote_left
std::string join(std::ranges::input_range auto strings, join_opt opt={})
Join the list of strings into a single string, using the separator given by opt.
void sort_case_insensitive(auto &range)
Sort the given range of strings in-place in a case-insensitive manner.
auto split(std::string_view full, std::string_view tok)
Split the string full on the first occurrence of tok.