| 1 |
#include <ClanLib/core.h> |
| 2 |
#include <ClanLib/application.h> |
| 3 |
|
| 4 |
#include <iostream> |
| 5 |
|
| 6 |
class CL_StringTest : public CL_ClanApplication |
| 7 |
{ |
| 8 |
|
| 9 |
int main(int argc, char** argv) |
| 10 |
{ |
| 11 |
CL_SetupCore::init(); |
| 12 |
|
| 13 |
double d = 55.67; |
| 14 |
float f = 44.7; |
| 15 |
int i = 23435; |
| 16 |
char c[] = "Werd!"; |
| 17 |
|
| 18 |
std::string test("Hi-ho-everybody!"); |
| 19 |
|
| 20 |
std::cout << CL_String::right(test, 3) << std::endl; |
| 21 |
std::cout << CL_String::left(test, 3) << std::endl; |
| 22 |
|
| 23 |
test.replace(test.begin(), test.begin()+2, "Bye-All"); |
| 24 |
|
| 25 |
std::cout << CL_String::format("This %1 is %2 a %3 test! %4 %5", test, d, f, i, c) << std::endl; |
| 26 |
|
| 27 |
std::cout << test << std::endl; |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |
| 31 |
|
| 32 |
|
| 33 |
} app; |