-
Notifications
You must be signed in to change notification settings - Fork 0
/
string.h
113 lines (93 loc) · 2.75 KB
/
string.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
////////////////////////////////////////////////////////////////////////////////
//
// string.h
//
// Created by Austin Cherry on 9/17/15.
// Copyright (c) 2015 Vluxe. All rights reserved.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef __AMP__String__
#define __AMP__String__
#include <string.h>
#include <stdbool.h>
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
bool strcontains(const char *string, const char *substring);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
bool strhasprefix(const char *string, const char *prefix);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
bool strhassuffix(const char *string, const char *suffix);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strjoin(const char *strings[], int stringsCount, const char *sep);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strrepeat(const char *string, int n);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strreplace(const char *string, const char *toReplace, const char *replacing, int n);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char **strsplit(const char *string, const char *sep, int *num);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strtitle(const char *string);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strlower(const char *string);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strupper(const char *string);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strformat(const char *string, ...);
/**
The websocket connected to its host.
@param socket is the current socket object.
*/
const char *strappend(const char *string, const char *string2);
/**
Return a pointer to the first non-whitespace character in string.
@param socket is the current socket object.
*/
const char *skipws(const char *string);
/**
Trims any trailing whitespace from the string.
@param socket is the current socket object.
*/
const char *trimws(const char *string);
/**
Return a pointer to the next whitespace character in string.
@param socket is the current socket object.
*/
const char *nextws(const char *string);
/**
Reverse the characters of a string.
@param socket is the current socket object.
*/
const char *reverse(const char *string);
#endif /* defined(__AMP__String__) */