-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeckoStringUtils.h
More file actions
44 lines (32 loc) · 824 Bytes
/
geckoStringUtils.h
File metadata and controls
44 lines (32 loc) · 824 Bytes
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
//
// Created by millad on 11/28/18.
//
#ifndef GECKO_GECKOSTRINGUTILS_H
#define GECKO_GECKOSTRINGUTILS_H
#include <cstdlib>
#include <vector>
#include <string>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <unistd.h>
#include <stdlib.h>
using namespace std;
inline
string &trim(string &str) {
str.erase(0, str.find_first_not_of(" \t\n")); //prefixing spaces
str.erase(str.find_last_not_of(" \t\n")+1); //surfixing spaces
return str;
}
inline
string &toUpper(string &str) {
std::transform(str.begin(), str.end(), str.begin(), ::toupper);
return str;
}
inline
string &toLower(string &str) {
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
return str;
}
void __geckoGetFields(char *line, vector<string> &v, char *delim);
#endif //GECKO_GECKOSTRINGUTILS_H