Test post

Testing a syntax highlighting plugin…

std::vector<std::string>  Util::split(const std::string& s, const std::string& delim, bool trim_spaces) {
    std::vector<std::string> result;
    if (delim.empty()) {
        result.push_back(s);
        return result;
    }
    std::string::const_iterator substart = s.begin(), subend;
    while (true) {
        subend = search(substart, s.end(), delim.begin(), delim.end());

        std::string temp(substart, subend);
        result.push_back((trim_spaces) ? Util::trim(temp) : temp);

        if (subend == s.end()) {
            break;
        }
        substart = subend + delim.size();
    }
    return result;
}

1 Comment

  1. jwez7158 January 28, 2012 at 11:05 pm

    Adding a comment

    Reply

Leave A Comment

Your email address will not be published. Required fields are marked *