StringUtility.cpp
// Splits a string into substrings, optionally including empty tokens if present.
Splits a string into substrings, optionally including empty tokens if present.
Splits a string into substrings optionally including empty tokens if present .
void StringUtility::Split(const std::string& stringToSplit, char delimator, bool excludeEmpty, std::vector<std::string>& splitStrings)
{
    splitStrings.clear();
    std::stringstream stringStream(stringToSplit);
    std::string item;
    while (std::getline(stringStream, item, delimator))
    {
        if (!excludeEmpty || (excludeEmpty && !item.empty()))
        {
            splitStrings.push_back(item);
        }
    }
}
void StringUtility :: Split ( const std :: string & stringToSplit , char delimator , bool excludeEmpty , std :: vector < std :: string > & splitStrings ) { splitStrings . clear ( ) ; std :: stringstream stringStream ( stringToSplit ) ; std :: string item ; while ( std :: getline ( stringStream , item , delimator ) ) { if ( ! excludeEmpty || ( excludeEmpty && ! item . empty ( ) ) ) { splitStrings . push_back ( item ) ; } } }
Splits a string into substrings, optionally including empty tokens if present.
Splits a string into substrings optionally including empty tokens if present .