diff --git a/src/str.cpp b/src/str.cpp index 82b497f1..e1ba1c7e 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -283,6 +283,14 @@ str::startswith(const string &str_, (str_.compare(0,prefix_.size(),prefix_) == 0)); } +bool +str::startswith(const string &str_, + const string_view prefix_) +{ + return ((str_.size() >= prefix_.size()) && + (str_.compare(0,prefix_.size(),prefix_) == 0)); +} + bool str::endswith(const string &str_, const string &suffix_)