mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-04 21:04:58 +02:00
Extend Split to work with multiple separators
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <locale>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
[[nodiscard]] inline std::vector<std::string> SplitString(std::string_view str, char sep)
|
||||
@@ -21,6 +22,11 @@
|
||||
return spanparsing::Split<std::string>(str, sep);
|
||||
}
|
||||
|
||||
[[nodiscard]] inline std::vector<std::string> SplitString(std::string_view str, std::string_view separators)
|
||||
{
|
||||
return spanparsing::Split<std::string>(str, separators);
|
||||
}
|
||||
|
||||
[[nodiscard]] inline std::string_view TrimStringView(std::string_view str, std::string_view pattern = " \f\n\r\t\v")
|
||||
{
|
||||
std::string::size_type front = str.find_first_not_of(pattern);
|
||||
|
||||
Reference in New Issue
Block a user