//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
	double d=1.0;

	AnsiString s0=d;
	ShowMessage(s0);

	AnsiString s1=(AnsiString)d;
	ShowMessage(s1);

	AnsiString s2=static_cast<AnsiString>(d);
	ShowMessage(s2);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{

	AnsiString s="  Helion  ";
	ShowMessage("$"+s+"$");
	s=s.Trim();                   //usuwanie spacji
	ShowMessage("$"+s+"$");
	ShowMessage(s.UpperCase());    //wielkie litery
	ShowMessage(s.LowerCase());    //małe litry
	s=s.SubString(0,3)+"lo!";         //podłańcuch i łączenie łańcuchów
	ShowMessage(s);
	s.Insert(", hello",6);        //wstawianie
	ShowMessage(s);
	ShowMessage("Pierwszy znak \"o\" znajduje się na pozycji "+IntToStr(s.Pos("o")));
	ShowMessage("Łańcuch \""+s+ "\" ma długość "+IntToStr(s.Length())+" znaków");
	s.Delete(2,7);                //usuwanie fragmentu
	ShowMessage(s);
	TReplaceFlags rf; rf << rfReplaceAll << rfIgnoreCase;
	s=StringReplace(s,"lo!","ion",rf);  //zastępowanie fragmentu
	ShowMessage(s);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click(TObject *Sender)
{
	AnsiString s="c:\\Program Files\\Borland\\BDS\\4.0\\bin";
	ShowMessage(s);
}
//---------------------------------------------------------------------------
