我需要确定文本框中的字符总数并在标签中显示值,但需要排除所有空格。
这是代码:
var
sLength : string;
i : integer;
begin
sLength := edtTheText.Text;
slength:= ' ';
i := length(sLength);
//display the length of the string
lblLength.Caption := 'The string is ' + IntToStr(i) + ' characters long';