blob: b951358a536e0b2f0216a53456f2f310f023b3fe (
plain)
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
|
#include "string.h"
int main(int argc, char **argv)
{
MyString mystr("alpha");
if (mystr.isSubstring("ph"))
{
cout << "true" << endl;
}
else
cout << "false" << endl;
MyString mystr1 = ", beta";
MyString mystr2 = ", charlie";
MyString mystr3 = ", delta";
mystr.concat(mystr1).concat(mystr2).concat(mystr3);
cout << mystr << endl;
MyString mystr4 = "hello";
mystr4.concat(", world!").concat(" goodbye");
cout << mystr4 << endl;
MyString mystr5 = "bro";
cout << mystr5 << endl;
return 0;
}
|