-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCodeToadTongue.h
45 lines (42 loc) · 1013 Bytes
/
CodeToadTongue.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
#include <iostream>
#include <string>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <msclr\marshal.h>
#include <fstream>
#include <vector>
#include <algorithm>
#include <functional>
#include <locale>
#include <sstream>
using namespace System;
using namespace System::Runtime::InteropServices;
//* STRIGN MANIPULATION */
//TRIMMING
// trim from end
static inline string &rtrim(string &s) {
s.erase(find_if(s.rbegin(), s.rend(), not1(ptr_fun<int, int>(isspace))).base(), s.end());
return s;
}
//// trim from start
static inline string <rim(string &s) {
s.erase(s.begin(), find_if(s.begin(), s.end(), not1(ptr_fun<int, int>(isspace))));
return s;
}
//// trim from both ends
static inline std::string &trim(std::string &s) {
return ltrim(rtrim(s));
}
double string_to_double( const std::string& s ) {
std::istringstream i(s);
double x;
if (!(i >> x))
return 0;
return x;
}
string Line(int a){
string l = "*";
for(int i = 0; i < a-2; i++) l+="-";
return l+"*";
}