unit1.~pas

来自「Delphi的函数例子」· ~PAS 代码 · 共 44 行

~PAS
44
字号
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
    function GetDateInfo(ID: String): String;
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

{ TForm1 }

function TForm1.GetDateInfo(ID: String): String;
begin
   Delete(ID,1,2);
   Delete(ID,9,10);
   Result := ID;

end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  panel1.Caption := GetDateInfo('RK20040501001');
end;

end.
 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?