码农的笔记

Delphi虽好,但已不流行; 博客真好,可以做笔记

博客园 首页 新随笔 联系 订阅 管理

var
s:string;
begin
SetLength(s,256);
GetWindowsDirectory(PChar(s),256);
ShowMessage(IntToStr(Length(s))); //Length(s) 256
ShowMessage(IntToStr(StrLen(PChar(s))));//StrLen(PChar(s))10
//SetLength(s,StrLen(PChar(s))); //没有这句,会有一堆的空格
ShowMessage(s);
end;

posted on 2021-06-16 17:55  码农的笔记  阅读(148)  评论(0编辑  收藏  举报