diff --git a/src/str.cpp b/src/str.cpp index b02778f3..470258da 100644 --- a/src/str.cpp +++ b/src/str.cpp @@ -352,11 +352,12 @@ std::string str::remove_prefix(const std::string &str_, const std::string_view prefix_) { - if(str_.size() < prefix.size()) - return str_; - if( + if(str::startswith(str_,prefix_)) + { + std::string s{str_}; + + s.erase(0,prefix_.size()); + } - if((str_.size() >= prefix.size()) && - std::equal(prefix.begin(),prefix.end(),str_.begin())) - return + return str_; }