forked from cassiobotaro/60-days-of-go
-
Notifications
You must be signed in to change notification settings - Fork 2
/
mystring.h
28 lines (24 loc) · 979 Bytes
/
mystring.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
#ifndef new
#define new {.equals=equals, .length=length, .equalsIgnoreCase=equalsIgnoreCase, .substring=substring,.toUpperCase=toUpperCase, .toLowerCase=toLowerCase, .replace=replace, .lastIndexOf=lastIndexOf, .firstIndexOf=firstIndexOf};
#endif
#include "mystring.c"
int equals(char* str1, char* str2);
int length(char *str);
int firstIndexOf(char *str,char i);
int lastIndexOf(char *str,char i);
void toUpperCase(char *str);
void toLowerCase(char *str);
void replace(char *str, char o, char n);
void substring(char *str, char *sub, int ini, int end);
int equalsIgnoreCase(char *string, char *string_aux);
typedef struct {
int (*equals)(char*, char*);
int (*length)(char*);
int (*equalsIgnoreCase)(char*, char*);
void (*substring)(char*, char*, int, int);
void (*toUpperCase)(char*);
void (*toLowerCase)(char*);
void (*replace)(char*, char, char);
int (*lastIndexOf)(char*, char);
int (*firstIndexOf)(char*, char);
}String;