8 #ifndef BLACKCAT_TENSORS_STRING_EXTENSIONS_H_ 9 #define BLACKCAT_TENSORS_STRING_EXTENSIONS_H_ 24 using std::string::string;
26 string(
const string&) =
default;
27 string(
string&&) =
default;
39 return this->size() >= str.size() &&
40 this->substr(0, str.size()) == str;
44 if (this->size() < str.size())
47 auto start_idx = this->size() - str.size();
48 return this->substr(start_idx, str.size()) == str;
52 return this->size() && (*this)[0] == c;
56 return this->size() && this->back() == c;
60 std::vector<bc::string>
split(
char delim)
const {
61 std::vector<bc::string> splits;
63 auto curr = this->begin();
int count(char value) const
Definition: string.h:34
bool endswith(const bc::string &str) const
Definition: string.h:43
string(std::string s)
Definition: string.h:31
bool startswith(char c) const
Definition: string.h:51
std::vector< bc::string > split(char delim) const
Definition: string.h:60
class::::::Args static auto find(bc::streams::Stream< bc::host_tag > stream, Begin begin, End end, Args... args)
Definition: algorithms.h:124
class::::::Args static auto count(bc::streams::Stream< bc::host_tag > stream, Begin begin, End end, Args... args)
Definition: algorithms.h:122
Inherits from std::string.
Definition: string.h:21
bool endswith(char c) const
Definition: string.h:55
The Evaluator determines if an expression needs to be greedily optimized.
Definition: algorithms.h:22
string & operator=(const string &)=default
bool startswith(const std::string &str) const
Definition: string.h:38