Delphi 随机指定范围的字符串函数


本文整理自网络,侵删。

 
function MakeRNDString(Chars: string; Count: Integer): string;
var
  i, x: integer;
begin
  Result := '';
  for i := 0 to Count - 1 do
  begin
    x := Length(chars) - Random(Length(chars));
    Result := Result + chars[x];
    chars := Copy(chars, 1,x - 1) + Copy(chars, x + 1,Length(chars));
  end;
end;

procedure TForm2.FormCreate(Sender: TObject);
begin
form2.Caption:=MakeRNDString('ABCDEFG',4);

end;

相关阅读 >>

Delphi 比较版本号

Delphi ttabcontrol

Delphi 通�^窗口句柄或窗口标题得到进程句柄

Delphi获取程序自身路径的函数

Delphi实现qq右下角弹出信息窗口

Delphi unigui 获取当前ip

Delphi xe2-firemonkey 新功能

Delphi idhttp post 支持 gzip 解压缩

Delphi 创建新的messagebox窗口前,先关掉之前已经创建好的

Delphi tfilestream流操作1

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...