Skip to content

Commit

Permalink
Insert some code.
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuDutSik committed Oct 23, 2023
1 parent 57d2318 commit 975a20d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src_basic/Basic_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,17 @@ std::vector<int> STRING_Split_Int(std::string const &eStrA,
return LInt;
}

std::string DropSpace(std::string const& strI) {
std::string strO;
for (int u=0; u<strI.size(); u++) {
std::string eChar = strI.substr(u,1);
if (eChar != " ") {
strO += eChar;
}
}
return strO;
}

// Example of use eStrA="A B C D" and eStrB=" "
// Difference with the above is that splitting ";;" gives you a list
// of entries as {"", "", ""}, i.e. last and first entry and entry in the middle
Expand Down

0 comments on commit 975a20d

Please sign in to comment.