-@param seq A sequence of strings
-@param sep Separator to be inserted between strings
-*/
-template<typename T>
-string join(const T &seq, const string &sep)
+vector<string> split(const string &str, char sep, int max_split)
+{
+ return split(str, string(1, sep), max_split);
+}
+
+vector<string> split_long(const string &str, const string &sep, int max_split)
+{
+ return do_split<true, false>(str, sep, max_split);
+}
+
+vector<string> split_fields(const string &str, const string &sep, int max_split)
+{
+ return do_split<true, true>(str, sep, max_split);
+}
+
+vector<string> split_fields(const string &str, char sep, int max_split)
+{
+ return split_fields(str, string(1, sep), max_split);
+}
+
+string strip(const string &s)
+{
+ string result=s;
+ if(!result.erase(0, result.find_first_not_of(" \t\r\n")).empty())
+ result.erase(result.find_last_not_of(" \t\r\n")+1);
+ return result;
+}
+
+string c_unescape(const std::string &str)