// Justin C. Miller
// University of Wisconsin Oshkosh
// Made for: http://www.geocities.com/neonprimetime.geo/index.html
// Date: 2001
// Borland Builder 4.0
// C++ strings
// and everything they can do
// (string) +=
// (string) .append(string, int, int)
// (string) .assign(string, int, int)
// (string) .replace(int, int, string, int,int)
// (int) .length()
// (int) .find(string, int)
// (int) .compare(string) (0 if ==, -1 if <, 1 if >)
// (string) +
// (bool) !=
// (bool) ==
#include
#include
using namespace std;
int main()
{
string name = "neonprimetime" ;
string sentence = "The dog jumped over the moon." ;
cout << "C++ Strings...." << endl ;
cout << "#include " << endl ;
cout << "----------" << endl ;
cout << "name -> " << name << endl ;
cout << "sentence -> " << sentence << endl ;
cout << "name += sentence -> " << (name += sentence) << endl ;
name="neonprimetime" ;
sentence ="The dog jumped over the moon." ;
cout << "name.append(sentence, 0, 7) ->" << (name.append(sentence, 0 , 7)) << endl ;
name="neonprimetime" ;
sentence ="The dog jumped over the moon." ;
cout << "name.assign(sentence, 0, 5) ->" << (name.assign(sentence, 0, 4)) << endl ;
name="neonprimetime" ;
sentence ="The dog jumped over the moon." ;
cout << "name.replace(1, 1, sentence, 1 ,1) ->" << (name.replace(1, 1, sentence, 1, 1)) << endl ;
name="neonprimetime" ;
sentence ="The dog jumped over the moon." ;
cout << "name.length() ->" << (name.length()) << endl ;
cout << "sentence.length() ->" << (sentence.length()) << endl ;
sentence ="The dog jumped over the moon." ;
cout << "sentence.find(\"dog\", 0) -> at position " << (sentence.find("dog", 0)) < " << (name.compare(name)) << " (returns 0 if ==, -1 if <, 1 if > )" << endl ;
name="neonprimetime" ;
sentence ="The dog jumped over the moon." ;
cout << "name + sentence ->" << (name + sentence) << endl ;
name="neonprimetime" ;
sentence ="The dog jumped over the moon." ;
cout << "name == sentence ->" << (name == sentence) << endl ;
name="neonprimetime" ;
sentence ="The dog jumped over the moon." ;
cout << "name != sentence ->" << (name != sentence) << endl ;
return 0 ;
}
               (
geocities.com/neonprimetime.geo/cpp)                   (
geocities.com/neonprimetime.geo)