Whiteboard
An interface and tools for visualizing large and complex datasets
StringUtil.h
Go to the documentation of this file.
1 
2 #ifndef STRINGUTIL_H
3 #define STRINGUTIL_H
4 
5 #include <string>
6 #include <iostream>
7 #include <sstream>
8 #include <vector>
9 
10 using namespace std;
11 
12 string After(string &s, string &t);
13 string Before(string &s, string &t);
14 bool Contains(string &s, string &t);
15 
16 string After(string &s, char *t);
17 string Before(string &s, char *t);
18 bool Contains(string &s, char *t);
19 
20 bool ContainsAt(string &s, string &t, int at);
21 
22 int PositionAfter(string &in, string& s, int startSearchAt);
23 
24 inline string Stringify(int x)
25 {
26  ostringstream out;
27  out << x;
28  return (out.str());
29 }
30 
31 
32 int Tokenize( const string &a_string,
33  vector<char> &separators,
34  vector<string> &tokens );
35 
36 
37 int Tokenize( const string &a_string,
38  vector<string> &tokens );
39 
40 
41 
42 
43 #endif
bool Contains(string &s, string &t)
Definition: StringUtil.cc:43
int PositionAfter(string &in, string &s, int startSearchAt)
Definition: StringUtil.cc:4
string Before(string &s, string &t)
Definition: StringUtil.cc:31
string Stringify(int x)
Definition: StringUtil.h:24
bool ContainsAt(string &s, string &t, int at)
Definition: StringUtil.cc:82
int Tokenize(const string &a_string, vector< char > &separators, vector< string > &tokens)
Definition: StringUtil.cc:90
string After(string &s, string &t)
Definition: StringUtil.cc:20