Skip to content

Instantly share code, notes, and snippets.

@gurkanoluc
Created January 11, 2011 21:19
Show Gist options
  • Save gurkanoluc/775164 to your computer and use it in GitHub Desktop.
Save gurkanoluc/775164 to your computer and use it in GitHub Desktop.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, strUtils;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Button1: TButton;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
harf, kelime, temp : String;
harfSayisi, i, j : Integer;
begin
kelime := Edit1.Text;
harfSayisi := Length(kelime);
j := 1;
for i := 1 to harfSayisi do
begin
harf := Copy(kelime, i, 1);
if i <= harfSayisi then
begin
if( harf = ' ' ) then
begin
Label1.Caption := Label1.Caption + ReverseString(Copy(kelime, j, i - j)) + ' ';
j := i;
end
else if(i = harfSayisi) then
begin
Label1.Caption := Label1.Caption + ReverseString(Copy(kelime, j, harfSayisi - j + 1));
end;
end;
end;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment