-
Notifications
You must be signed in to change notification settings - Fork 0
/
SqString_Test.c
68 lines (54 loc) · 1.2 KB
/
SqString_Test.c
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
/*
* =====================================================================================
*
* Filename: SqString_Test.c
*
* Description:
*
* Version: 1.0
* Created: 11/30/2014 01:48:54 PM
* Revision: none
* Compiler: gcc
*
* Author: 张世龙 (mn), [email protected]
* Company: free
*
* =====================================================================================
*/
#include "Public.h"
#include "SqString.h"
int main()
{
String str1;
StrAssign(str1,"zhangshilong");
printString(str1);
String str2;
StrCopy(str2,str1);
printString(str2);
ClearString(str2);
printString(str2);
StrCopy(str2,str1);
printString(str2);
printf("%d\n",StrCompare(str1,str2));
String str3;
StrAssign(str3,"is");
StrInsert(str2,str2[0]+1,str3);
printString(str2);
printf("%d\n",StrCompare(str1,str2));
String str4;
Concat(str4,str1,str3);
printString(str4);
String str5;
SubString(str5,str4,11,4);
printString(str5);
String str6;
StrAssign(str6,"shi");
printf("%d\n",Index(str1,str6,1));
StrDelete(str1,1,5);
printString(str1);
String str7;
StrAssign(str7,"haha");
Replace(str1,str6,str7);
printString(str1);
return 0;
}