11USERVER_NAMESPACE_BEGIN
18std::string
Trim(
const std::string& str);
22std::string
Trim(std::string&& str);
26std::string_view
TrimView(std::string_view str);
28enum class SplitFlags {
30 kCompressAdjacentSeparators = 1 << 0,
38 std::string_view separators,
39 SplitFlags split_flags = SplitFlags::kCompressAdjacentSeparators
50std::string
Join(
const std::vector<std::string>& strs, std::string_view sep);
53std::string
Format(
double value,
int ndigits);
56constexpr bool StartsWith(std::string_view hay, std::string_view needle)
noexcept {
57 return hay.substr(0, needle.size()) == needle;
61constexpr bool EndsWith(std::string_view hay, std::string_view needle)
noexcept {
62 return hay.size() >= needle.size() && hay.substr(hay.size() - needle.size()) == needle;
69bool ICaseEndsWith(std::string_view hay, std::string_view needle)
noexcept;
89bool IsAscii(std::string_view text)
noexcept;
101bool IsValid(
const unsigned char* bytes, std::size_t length)
noexcept;
131void TakePrefix(std::string& text, std::size_t count)
noexcept;
140bool IsUtf8(std::string_view text)
noexcept;
146bool IsPrintable(std::string_view text,
bool ascii_only =
true)
noexcept;