This commit is contained in:
blueloveTH 2023-08-28 00:39:21 +08:00
parent e21005e5d2
commit eac3230a71
2 changed files with 2 additions and 2 deletions

View File

@ -73,7 +73,7 @@ struct Str{
Str escape(bool single_quote=true) const;
int index(const Str& sub, int start=0) const;
Str replace(const Str& old, const Str& new_, int count=-1) const;
std::vector<std::string_view> split(Str sep) const;
std::vector<std::string_view> split(const Str& sep) const;
/*************unicode*************/
int _unicode_index_to_byte(int i) const;

View File

@ -308,7 +308,7 @@ int utf8len(unsigned char c, bool suppress){
return _byte_index_to_unicode(size);
}
std::vector<std::string_view> Str::split(Str sep) const{
std::vector<std::string_view> Str::split(const Str& sep) const{
std::vector<std::string_view> result;
int start = 0;
while(true){