public static void main(String[] args)
	{
		if(args == null || args.length !=3)
		{
			System.err.println("usage: java Replace <instring> <what> <with>");
			System.exit(1);
		}

		System.out.println("creating Replace object r ...");
		Replace r = new Replace(args[0]);
		System.out.println("r after method replaceFirst: \t" + r.replaceFirst(args[1], args[2]));
		System.out.println("r has number replacements: \t" + r.getTotalNumberOfReplacements());

		System.out.println("static method replaceFirst: \t" + replaceFirst(args[0],args[1], args[2]));
		System.out.println("r has number replacements: \t" + r.getTotalNumberOfReplacements());

		System.out.println("r after method replaceLast: \t" + r.replaceLast(args[1], args[2]));
		System.out.println("r has number replacements: \t" + r.getTotalNumberOfReplacements());

		System.out.println("r after method replaceAll: \t" + r.replaceAll(args[1], args[2]));
		System.out.println("r has number replacements: \t" + r.getTotalNumberOfReplacements());

		System.out.println("================= history =================");
		
		for(int i = 0; i < r.replaceDataStack.size(); i++)
		{
			  System.out.print("at position ");
			  System.out.print(((Object[])(r.replaceDataStack.elementAt(i)))[0].toString());
			  System.out.print("\t what: ");
			  System.out.print(((Object[])(r.replaceDataStack.elementAt(i)))[1].toString());
			  System.out.print(" with: ");
			System.out.println(((Object[])(r.replaceDataStack.elementAt(i)))[2].toString());
		}
		System.out.println("================= undo =================");

		while(r.unDoLast())
		{
			System.out.println("after method unDoLast: \t" + r.currentString);
			System.out.println("r has number replacements:\t" + r.getTotalNumberOfReplacements());
		}
	}