14inline auto split(std::string_view full, std::string_view
tok) {
17 std::string_view key = full;
18 std::string_view
rem{key.data() + key.size(), 0};
19 return std::make_tuple(key,
rem);
22 std::string_view key = full.substr(0,
tok_pos);
24 return std::make_tuple(key,
rem);
33 std::string_view key{full.data(), 0};
34 std::string_view
rem = full;
35 return std::make_tuple(key,
rem);
38 std::string_view key = full.substr(0,
tok_pos);
40 return std::make_tuple(key,
rem);
46 std::string_view
sep =
", ";
54 if (std::ranges::empty(
strings))
55 return std::string(
opt.empty);
59 return std::move(
acc);
61 auto begin = std::ranges::begin(
strings);
62 auto end = std::ranges::end(
strings);
63 using std::ranges::next;
64 std::string
first{*begin};
70 std::string_view
sep =
", ";
82 if (std::ranges::empty(
strings))
83 return std::string(
opt.empty);
89 return std::move(
acc);
91 auto begin = std::ranges::begin(
strings);
92 auto end = std::ranges::end(
strings);
93 std::string
first{*begin};
95 using std::ranges::next;
97 result +=
opt.quote_right;
103 auto cmp = [](
const auto &
a,
const auto &b) {
104 auto toupper = [](
unsigned char c) {
return std::toupper(c); };
105 return std::ranges::lexicographical_compare(
107 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.