3 stupid test program to verify stringlib
9 #include "string-convert.hh"
14 cout
<< "constructors"<<endl
;
20 String
fromf (1.32e-2, "%g");
37 a
.sort (String::compare_i
);
38 cout
<< "compares: "<<endl
;
39 for (int i
=0; i
< a
.size(); i
++)
47 String hay
= "foobarbazblub";
52 cout
<< "hay = \"" << hay
<< "\" len="<< hay
.length_i()<<endl
;
53 cout
<< "index_i ('"<< c
<<"') " << c
<< "= " << hay
.index_i (c
) <<endl
;
54 cout
<< "last_index_i ('"<< c
<<"') " << c
<< "= " << hay
.index_last_i (c
) <<endl
;
55 // cout << "last index of cstr " << c << ": " << hay.index_last_i (cstr) <<endl;
56 // cout << "index_last_i (\""<<set<<"\"): " << hay.index_last_i (set) <<endl;
57 cout
<< "index_i (\""<<set
<<"\"): " << hay
.index_i (set
) <<endl
;
58 cout
<< "index_any (\"" << set
<< "\"): " << cstr
<< ": " << hay
.index_any_i (cstr
) <<endl
;
69 for (int i
=-1; i
< str
.length_i()+2; i
++)
71 cout
<<" left_str (" << i
<<"): " << str
.left_str (i
) << endl
;
72 cout
<<" right_str ("<<i
<<"): " << str
.right_str (i
) << endl
;
76 cout
<< "mid (2,6)="<<str
.mid_str (2,3)<<endl
;
77 cout
<< "nomid (2,6)="<<str
.nomid_str (2,3)<<endl
;
89 cout
<< "left" << endl
;
93 str
= String ("Hallo") + " daaR" + '!';
96 cout
<< "up: " << str
.upper_str() << " down: " << str
.lower_str ()<<endl
;
98 if (str
== String ("") )
99 cout
<< str
<< " is empty" << endl
;
101 cout
<< str
<< " is not empty"<<endl
;
106 cout
<< fn
<< " is empty" << endl
;
112 delete fn
.copy_byte_p();
113 delete str
.copy_byte_p();
115 cout
<< String_convert::bin2hex_str (String ((char)0xff) ) << endl
;