小编use*_*092的帖子

如何计算字符串中的字符,不包括某些类型?

我需要确定文本框中的字符总数并在标签中显示该值,但是需要排除所有空格.

这是代码:

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';
Run Code Online (Sandbox Code Playgroud)

delphi string counting

5
推荐指数
1
解决办法
6442
查看次数

Delphi中的FormShow

我想知道delphi 2010中的formhow在哪里,因为我只能在项目中看到formcreate.

我问的原因是因为我需要在FormShow事件处理程序中添加Randomize,如下所示:

procedure TfrmWinnaSpree.FormShow(Sender: TObject);
begin
  Randomize;
end;
Run Code Online (Sandbox Code Playgroud)

delphi

0
推荐指数
1
解决办法
4688
查看次数

标签 统计

delphi ×2

counting ×1

string ×1