Registriert seit: 24. Mär 2009
1 Beiträge
Delphi 2005 Architect
|
Re: Worte zählen im Memo
24. Mär 2009, 08:31
Hi.
Maybe this helps.
Delphi-Quellcode:
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm4 = class(TForm)
Memo1: TMemo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.Button1Click(Sender: TObject);
var stList: TStringList;
ss: string;
WorteCount:integer;
xx:integer;
begin
stList := TStringList.Create;
ss := Memo1.Text;
ss:= StringReplace(ss,' ', #13#10, [rfReplaceAll]);
stlist.Text := ss;
WorteCount := stList.Count;
ShowMessage(' WorteCount is '+ IntToStr(WorteCount));
FreeandNil(stList);
end;
end.
|
|
Zitat
|