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;
}

 
 
 

One Response to “Test post”

  1. jwez7158
    28. January 2012 at 23:05

    Adding a comment

Leave a Reply