13#ifndef ROOT_StringUtils
14#define ROOT_StringUtils
26std::vector<std::string>
Split(std::string_view str, std::string_view
delims,
bool skipEmpty =
false);
35std::pair<std::string_view, std::string_view>
SplitAt(std::string_view str,
char splitter);
45template <
typename InputIt_t>
51 return std::accumulate(std::next(begin), end, *begin, [&sep](
auto const &
a,
auto const &
b) {
return a + sep +
b; });
61template <
class StringCollection_t>
67std::string
Round(
double value,
double error,
unsigned int cutoff = 1, std::string_view
delim =
"#pm");
69inline bool StartsWith(std::string_view
string, std::string_view prefix)
71 return string.size() >= prefix.size() &&
string.substr(0, prefix.size()) == prefix;
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
bool EndsWith(std::string_view string, std::string_view suffix)
std::string Join(const std::string &sep, InputIt_t begin, InputIt_t end)
Concatenate a list of strings with a separator.
bool StartsWith(std::string_view string, std::string_view prefix)
std::string Round(double value, double error, unsigned int cutoff=1, std::string_view delim="#pm")
Convert (round) a value and its uncertainty to string using one or two significant digits of the erro...
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
std::pair< std::string_view, std::string_view > SplitAt(std::string_view str, char splitter)
Given a string str, returns a pair of string views into it: the first containing the substring preced...