Function splitString

Synopsis

#include <lib/inc/drogon/utils/Utilities.h>

std::vector< std::string > splitString(const std::string &str, const std::string &separator, bool acceptEmptyString=false)

Description

Split the string into multiple separated strings.

Parameters

acceptEmptyString - if true, empty strings are accepted in the result, for example, splitting the ",1,2,,3," by "," produces ["","1","2","","3",""]

Source

Lines 63-68 in lib/inc/drogon/utils/Utilities.h.

inline std::vector<std::string> splitString(const std::string &str,
                                            const std::string &separator,
                                            bool acceptEmptyString = false)
{
    return trantor::splitString(str, separator, acceptEmptyString);
}





Add Discussion as Guest

Log in