Skip to content

Instantly share code, notes, and snippets.

View ju1ion's full-sized avatar

ju1ion

  • Gelsenkirchen, NRW, Germany
View GitHub Profile
@ju1ion
ju1ion / endswith.hpp
Last active June 1, 2016 09:37
C++ String ends_with without boost
static bool endswithA(std::string const &InputString, std::string const &compareString)
{
if (InputString.length() >= compareString.length()) {
return (0 == InputString.compare(InputString.length() - compareString.length(), compareString.length(), compareString));
}
else {
return false;
}
};
@ju1ion
ju1ion / split.hpp
Created June 1, 2016 09:39
C++ String split without boost
public:
static std::vector<std::string> splitStrA(const std::string &InputString, char delimiterChar) {
std::vector<std::string> ResultVec;
splitStrA(InputString, delimiterChar, ResultVec);
return ResultVec;
};
static std::vector<std::wstring> splitStrW(const std::wstring &InputString, wchar_t delimiterChar) {
std::vector<std::wstring> ResultVec;
splitStrW(InputString, delimiterChar, ResultVec);