// Copyright 2004-present Facebook. All Rights Reserved. #include "osquery/core.h" #include #include namespace osquery { namespace core { std::vector split(const std::string& s) { return split(s, "\t "); } std::vector split(const std::string& s, const std::string& delim) { std::vector elems; boost::split(elems, s, boost::is_any_of(delim)); auto start = std::remove_if( elems.begin(), elems.end(), [](const std::string& s) { return s == ""; }); elems.erase(start, elems.end()); for (auto& each : elems) { boost::algorithm::trim(each); } return elems; } } }