util.h
Go to the documentation of this file.00001 #ifndef UTIL_H
00002 #define UTIL_H
00003
00004 #include <string>
00005 #include <vector>
00006 using namespace std;
00007
00008
00009
00010
00011
00012 vector<string> split(const string &str);
00013
00014 vector<string> split(const string &str, const string sep);
00015
00016
00017 vector<string> split(const string &str, int nf);
00018
00021 void rmspace(string &s);
00022
00023 void erase(string &s, const string &sub);
00024
00025 void replace(string &s, const string &sub, const string &r);
00026 void replaceInnerQuote(string &s);
00027
00028
00029
00030
00031 bool remove_end_mark(string &s, const char m[]=".;", int n=2);
00032
00033
00034 bool startWith(const string &s1, const string &s2);
00035 bool startWithIgnoreCase(const string &s1, const string &s2);
00036
00037 string toupper(const string &s);
00038
00039
00040 string acronym(const string &s);
00041 string firstWord(const string &s);
00042
00043 #endif