-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrops.h
90 lines (44 loc) · 2.47 KB
/
strops.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#ifndef STROPS_H
#define STROPS_H
#include <string>
#include <vector>
using namespace std;
bool isNumber(const string& str);
bool stob(const string& str);
string StringRaw(const string& s);
string Quoted(const string& s);
string RMParenthesis(const string& s);
string ltrim(const string& s);
string rtrim(const string& s);
string trim(const string& s);
vector<string> split(const string& str, const char& del);
vector<string> split(const string& str, const string& del);
string betweenChars(const string& str, const char& openChar, const char& closeChar);
string firstLevelInDelim(const string& str, const char& openChar, const char& closeChar, int startPosition = 0);
vector<string> splitNoOverlap(const string& str, const char& splitBy, const char& openChar, const char& closeChar);
vector<string> splitOutsideDelim(const string& str, const string& del, const char& delim);
int count(const string& str, const char& ch);
int countStr(const string& str, const string& ch);
std::vector<int> strPositions(const string& str, const string& sc);
int countNoOverlap(const string& str, const char& searchFor, const char& ch1, const char& ch2);
string makeSectionsFromDelim(vector<string> splitStr, const string& sectionStart, const string& sectionEnd, bool startActive);
int countOutsideDelim(const string& str, const string& sc, const char& delim);
int countOutsideParenthesis(const string& str, const char& searchFor);
int indexInStr(const string& str, const char& ch);
int charIndexInVec(const vector<string>& str, const char& ch);
int countInVector(const vector<string>& str, const string& ch);
string Vec2Str(const vector<string>& str);
vector<vector<string>> removeTabsWdArry(const vector<vector<string>>& str, const int& amnt);
vector<string> removeTabs(const vector<string>& str, const int& amnt);
vector<string> rangeInVec(const vector<string>& str, const int& min, int max);
vector<string> slice(vector<string> const& v, int min, int max);
string rangeInStr(const string& str, const int& min, int max);
string unWrapVec(const vector<string>& vec);
float floatval(const string& s);
string replace(const string& str, const string& strToReplace, const string& replaceWith);
string replaceIfOneWord(const string& str, const string& strToReplace, const string& replaceWith);
bool isEscaped(const string& str, int curChar);
bool startsWith(const string& str, const string& lookFor);
std::string escaped(const std::string& input);
std::string capitalize(const std::string& input);
#endif