Skip to content

Commit 94b8a63

Browse files
committed
Utilitaires -> .cpp
1 parent 230789b commit 94b8a63

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

headers/Utils.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "Utils.h"
2+
3+
std::vector<std::string> split(std::string& arg) {
4+
std::string myBuffer;
5+
6+
std::vector<std::string> myVec;
7+
8+
std::stringstream ss;
9+
ss << arg;
10+
while (ss >> myBuffer) {
11+
myVec.push_back(myBuffer);
12+
}
13+
14+
return myVec;
15+
}
16+
17+
std::vector<char> splitChar(std::string& arg) {
18+
std::istringstream iss(arg);
19+
std::vector<char> vec((std::istream_iterator<char>(iss)), std::istream_iterator<char>());;
20+
21+
return vec;
22+
}
23+
24+
std::string replaceFPL(std::string& line, std::string& what) {
25+
std::string result = line.replace(line.find(what), what.length(), "");
26+
return result;
27+
}

0 commit comments

Comments
 (0)