72
73
74
75
76
77
78
79
80
81
82
|
newstr = [self resizeMem: string
toSize: newlen + 1];
memcpy(newstr + length, str, strlength + 1);
length = newlen;
string = newstr;
return self;
}
@end
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
newstr = [self resizeMem: string
toSize: newlen + 1];
memcpy(newstr + length, str, strlength + 1);
length = newlen;
string = newstr;
return self;
}
- reverse
{
size_t i, j, len = length / 2;
for (i = 0, j = length - 1; i < len; i++, j--) {
string[i] ^= string[j];
string[j] ^= string[i];
string[i] ^= string[j];
}
return self;
}
@end
|