Delphi 2009 之 TStringBuilder 类[7]: ToString


本文整理自网络,侵删。

 
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

//TStringBuilder.ToString 可以带参数
procedure TForm1.Button1Click(Sender: TObject);
var
  sb: TStringBuilder;
begin
  sb := TStringBuilder.Create('123456789');

  ShowMessage(sb.ToString);       {123456789}
  ShowMessage(sb.ToString(3, 4)); {4567}

  sb.Free;
end;

end.

相关阅读 >>

Delphi编写你的第一个com程序

Delphi 关于禁止程序重复启动的另一种需要与实现

Delphi 关于构造方法的重写

Delphi保存读取utf-8的文本文件

wmi使用的win32_类库名

Delphi idhttp超时重定向

Delphi ttabcontrol

Delphi读写utf-8、unicode格式文本文件

Delphi format格式化函数

Delphi 让子窗体显示最大化

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...