Delphi - check if a string is empty?

Soldato
Joined
8 Jan 2009
Posts
4,819
Location
North East
hi, how can you check if a string is empty, by empty i mean it either contains visible text, if it doesnt or contains spaces and carriage returns then this is still classed as empty.

the below only checks if nothing has been entered, but if the memo contains spaces or carriage returns it thinks the memo contains data:

procedure TForm1.Button1Click(Sender: TObject);
begin
if memo1.lines.text = '' then showmessage('empty') else showmessage('used');
end;

cheers
 
Back
Top Bottom