Browse Source

str.cpp

webui
Antonio SJ Musumeci 1 week ago
parent
commit
4eaae4909d
  1. 13
      src/str.cpp

13
src/str.cpp

@ -352,11 +352,12 @@ std::string
str::remove_prefix(const std::string &str_, str::remove_prefix(const std::string &str_,
const std::string_view prefix_) 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_;
} }
Loading…
Cancel
Save