move(), copymemory()

move()

var
  buf1,buf2: array[0..9] of AnsiChar;
begin
  buf1 := '0123456789';
  buf2 := 'abcdefghij';

  Move(buf2[2], buf1[4], 5);

  ShowMessage(buf1); {0123cdefg9}
  ShowMessage(buf2); {abcdefghij}
end;

copymemory()
var
  buf1,buf2: array[0..9] of AnsiChar;
begin
  buf1 := '0123456789';
  buf2 := 'abcdefghij';

  CopyMemory(@buf2[2], @buf1[4], 5);

  ShowMessage(buf1); {0123456789}
  ShowMessage(buf2); {ab45678hij}
end;

原文地址:https://www.cnblogs.com/hnxxcxg/p/2940800.html