RSTools 3.1.0
Versatile C++20 utility library
Loading...
Searching...
No Matches
Split.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <string_view>
5#include <vector>
6
7namespace RST::String {
8
12
14 [[nodiscard]] std::vector<std::string> splitString(std::string_view str, std::string_view delimiters);
15
17 [[nodiscard]] std::vector<std::string_view> splitStringView(std::string_view str, std::string_view delimiters);
18
20 [[nodiscard]] std::vector<std::string> splitStringWithQuotes(std::string_view str, std::string_view delimiters, char quote = '\"');
22}
String helpers: case, trimming, splitting, joining, replacing, parsing and hashing.
Definition Char.hpp:3
std::vector< std::string_view > splitStringView(std::string_view str, std::string_view delimiters)
Splits str into views, without copying: str must outlive them.
std::vector< std::string > splitStringWithQuotes(std::string_view str, std::string_view delimiters, char quote='\"')
Splits str, keeping the delimiters found between two quote characters and removing the quotes.
std::vector< std::string > splitString(std::string_view str, std::string_view delimiters)
Splits str into strings.
std::optional< T > parseNumber(std::string_view text, int base=10) noexcept
Parses text as a number, or returns std::nullopt if it is not entirely one.
Definition Convert.hpp:23