summaryrefslogtreecommitdiff
path: root/src/str.hh
blob: e1ee549c0849ae81a3e442c4fbf1af1a7d671b80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef STR_HH
#define STR_HH

#include <string_view>
#include <vector>

namespace str {

void split(std::string_view str, std::vector<std::string_view>& out,
           char separator = ' ', bool keep_empty = false);

[[nodiscard]] std::vector<std::string_view> split(std::string_view str,
                                                  char separator = ' ',
                                                  bool keep_empty = false);

[[nodiscard]]
std::string_view trim(std::string_view str);

}  // namespace str

#endif  // STR_HH