欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

Delphi

當前位置:主頁 > 軟件編程 > Delphi >

截取指定符號之間的字符串(隨機讀取)delphi實例代碼

來源:本站原創(chuàng)|時間:2020-01-10|欄目:Delphi|點擊: 次

復制代碼 代碼如下:

unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    test: TMemo;
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

function   PosEx(const   Source,   Sub:   string;   Index:   integer):   integer;
var
   Buf                               :   string;
   i,   Len,   C                   :   integer;
begin
   C   :=   0;
   Result   :=   0;
   Buf   :=   Source;
   i   :=   Pos(Sub,   Source);
   Len   :=   Length(Sub);
   while   i   <>   0   do
   begin
       inc(C);
       Inc(Result,   i);
       Delete(Buf,   1,   i   +   Len   -   1);
       i   :=   Pos(Sub,   Buf);
       if   C   >=   Index   then   Break;
       if   i   >   0   then   Inc(Result,   Len   -   1);
   end;
   if   C   <   Index   then   Result   :=   0;
end;


procedure TForm1.Button1Click(Sender: TObject);
var
i,y:integer;
x,c:string;
g,g1:integer;
begin
 randomize;  //生成隨機數(shù)種子
            i:=random(30);
            y:=i+1;

 c:='topfox000|topfox001|topfox002|topfox003|topfox004|topfox005|topfox006|topfox0007|topfox008|topfox009|tellyoumysecret000|tellyoumysecret002|tellyoumysecret003|tellyoumysecret004|tellyoumysecret005|tellyoumysecret006|'+
'onhacker046|onionhacker047|onionhacker048|onionhacker049|onionhacker140|onionhacker141|onionhacker142|onionhacker143|onionhacker144';
 test.text:=test.text+inttostr(PosEx( c, '|',i));//返回5
  g:= PosEx( c, '|',i)+1;//返回5
test.text:=test.text+inttostr(PosEx( c, '|',y));//返回5
   g1:=PosEx( c, '|',y);//返回5
x:=Copy(c,g,g1-g);
memo1.text:=x;

end;

end.

上一篇:delphi中exit,abort,break,continue的區(qū)別介紹

欄    目:Delphi

下一篇:delphi xe 可用的MD5算法

本文標題:截取指定符號之間的字符串(隨機讀取)delphi實例代碼

本文地址:http://mengdiqiu.com.cn/a1/Delphi/8649.html

網(wǎng)頁制作CMS教程網(wǎng)絡編程軟件編程腳本語言數(shù)據(jù)庫服務器

如果侵犯了您的權利,請與我們聯(lián)系,我們將在24小時內(nèi)進行處理、任何非本站因素導致的法律后果,本站均不負任何責任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權所有