From 8cd5af560eb244de5fb3fd42950b150f0f7bdffc Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 19 Feb 1997 14:47:22 +0000 Subject: [PATCH] flower-1.1.0 --- flower/stringtest.cc | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 flower/stringtest.cc diff --git a/flower/stringtest.cc b/flower/stringtest.cc new file mode 100644 index 0000000000..71c1557912 --- /dev/null +++ b/flower/stringtest.cc @@ -0,0 +1,43 @@ +// stringtest.cc + +#include +#include "string.hh" + +int +main() +{ + String str( "hai" ); + cout << str << endl; + cout << "left" << endl; + cout << " 0:" << str.left( 0 ) << endl; + cout << " 1:" << str.left( 1 ) << endl; + cout << " 2:" << str.left( 2 ) << endl; + cout << " 3:" << str.left( 3 ) << endl; + cout << " 4:" << str.left( 4 ) << endl; + cout << "right" << endl; + cout << " 0:" << str.right( 0 ) << endl; + cout << " 1:" << str.right( 1 ) << endl; + cout << " 2:" << str.right( 2 ) << endl; + cout << " 3:" << str.right( 3 ) << endl; + cout << " 4:" << str.right( 4 ) << endl; + + str += " daar"; + cout << str << endl; + + str = String( "hallo" ) + " daar" + '!'; + cout << str << endl; + + if ( str == String( "" ) ) + cout << str << " is empty" << endl; + String fn = ""; + if ( fn == "" ) + cout << fn << " is empty" << endl; + + fn = ""; + fn += ""; + delete fn.copy_by_p(); + + delete str.copy_by_p(); + + cout << StringConversion::bin2hex_str( String( (char)0xff ) ) << endl; +} -- 2.11.4.GIT