-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathStringUtil.h
38 lines (29 loc) · 1.05 KB
/
StringUtil.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
#ifndef _STRINGUTIL_H_
#define _STRINGUTIL_H_
#include <string>
#include <vector>
namespace StringUtil {
/**
* Trim string
*
* @param input string to trim
* @return returns trimmed string
*/
std::string Trim(const std::string& input);
/**
* Split string
*
* @param input string to split
* @param delimiter delimiter string to trim
* @param results results vector with substrings
* @param trim boolean to indicate trimming or not
* @return returns number of substrings
*/
int Split(const std::string& input, const std::string& delimiter, std::vector<std::string>& results, bool trim);
std::string Substitute(char s, char d, const std::string& str);
void StrSub(std::string& cp, const std::string& sub_this, const std::string& for_this, const int& num_times);
std::string ToLower(const std::string& s);
std::string GetFileExtension(const std::string& filename);
std::string GetFilenamePart(const std::string& fullpath);
}
#endif