现在的位置: 首页 > 综合 > 正文

SysUtils.StrMove

2011年01月01日 ⁄ 综合 ⁄ 共 475字 ⁄ 字号 评论关闭
其实这也是个 Copy 函数, 和 Move 没有关系.

unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
var
  p: PChar;
begin
  p := PChar(StringOfChar('A', 9));

  StrMove(p, '12345', 3);
  ShowMessage(p); {123AAAAAA}

  StrMove(p, '67890', 5);
  ShowMessage(p); {67890AAAA}

  StrMove(p, '12345', 7);
  ShowMessage(p); {12345}
end;

end.

SysUtils 单元下的公用函数目录


抱歉!评论已关闭.