Skip to content

Commit

Permalink
Some insert.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuDutSik committed Oct 23, 2023
1 parent f6a3383 commit 57d2318
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src_basic/Basic_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,20 @@ std::string STRING_RemoveSpacesBeginningEnd(std::string const &eStr) {
return RetStr;
}

bool startswith(std::string const& str1, std::string const& str2) {
size_t len1 = str1.size();
size_t len2 = str2.size();
if (len1 < len2) {
return false;
}
std::string str1_red = str1.substr(0,len2);
if (str1_red == str2) {
return true;
}
return false;
}


template <typename F>
void STRING_Split_f(std::string const &eStrA, std::string const &eStrB, F f) {
size_t lenA = eStrA.length();
Expand Down

0 comments on commit 57d2318

Please sign in to comment.