其他分享
首页 > 其他分享> > SysUtils.StrLCat

SysUtils.StrLCat

作者:互联网

SysUtils.StrLCat

StrLCat 与 StrCat 类似, StrLCat 多出的参数好像是限制结果的长度.
unit Unit1;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  arr: array[0..255] of Char;
begin
  StrCopy(arr, '12345');
  StrCat(arr, 'ABCDEFG');
  ShowMessage(arr); {12345ABCDEFG}
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  arr: array[0..255] of Char;
begin
  StrCopy(arr, '12345');

  StrLCat(arr, 'ABCDEFG', 7);
  ShowMessage(arr); {12345AB}
end;

end.
SysUtils 单元下的公用函数目录

posted on 2008-05-12 22:40  万一  阅读(1785)  评论(1)  编辑  收藏

标签:arr,end,Sender,TForm1,TObject,SysUtils,StrLCat
来源: https://blog.51cto.com/u_14617575/2746264