reVeno/Source/Veno/Utils/StringUtils.cpp
Maurice Grönwoldt 61482e8d4c WIP
2020-07-09 16:31:33 +02:00

21 lines
529 B
C++

//
// Created by Maurice on 08.07.2020.
//
#include "StringUtils.h"
std::vector<std::string> VeNo::StringUtils::split (std::string input, std::string separator)
{
std::vector<std::string> result;
std::string_view::size_type position, start = 0;
while (std::string_view::npos != (position = input.find (separator, start)))
{
result.push_back (input.substr (start, position - start));
start = position + separator.size ();
}
result.push_back (input.substr (start));
return result;
}