-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstring_utils.h
48 lines (40 loc) · 1.35 KB
/
string_utils.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
/*//////////////////////////////////////////////
* AUTHOR = LI LINHAN
* ZHANG WENDIAN
* JIA JIAHUA
* DESCRIPTION: this is a header file for string_utils.c
* for CSCE 155E HACK8.0
*
* DATE: Oct.12, 2018
//////////////////////////////////////////////*/
/*///////////////////////////////////////////
* replace the oldchar in the given string
* with newChar
*/
void replaceChar(char *s, char oldChar, char newChar);
/*///////////////////////////////////////////
* return the pointer to the copy of the given
* string, s, with old char replaced by newchar
*/
char * replaceCharCopy(const char *s, char oldChar, char newChar);
/*///////////////////////////////////////////
* remove char c from the string s, and
* shift down the characters to fill the blanks
*/
void removeChar(char *s, char c);
/*///////////////////////////////////////////
* return the pointer to the copy of the given
* string, with char c removed
*/
char * removeCharCopy(const char *s, char c);
/*///////////////////////////////////////////
* cut the given string into substrings of
* given lenght, store them in to a 2D array
* and returns a pointer to it.
*/
char **lengthSplit(const char *s, int n);
/*///////////////////////////////////////////
* make a copy of the given string.
* returns a pointer to it
*/
char * makeCopy(const char *s);