SetLength 过程设定字符串的最大长度值
//SetLength为了有效地分配所需的存储空间,你可以用SetLength 过程设定字符串的最大长度值:
procedure TForm1.Button1Click(Sender: TObject);
var
str1 :string;
begin
str1:= 'Hello World';
SetLength (str1, 3);//设定str1 的字符长度为3个字符
edit1.text := str1;
end;

浙公网安备 33010602011771号