delphi字符串固定长度换行
2021-06-06 20:05
标签:int while osi 字符 换行 长度 auto com val delphi字符串固定长度换行 标签:int while osi 字符 换行 长度 auto com val 原文地址:https://www.cnblogs.com/semth/p/10763520.htmlvar str,capstr:string;
i,j:integer;
....................j:=500; //这个地方可能要根据你显示的宽度来换算对应的字符长度
str:=somestring;capstr:=‘‘
i:=1
while i
dobegin capstr:=capstr+copy(str,i,j)+#13#10;
i:=i+j;
end;
label1.WordWrap:=true;
label1.AutoSize:=true;
label1.Font.Name:=‘宋体‘;
label1.Caption:=capstr;
........................
下一篇:知乎专栏开放性api