⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit1.~pas

📁 Delphi的函数例子
💻 ~PAS
字号:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  Stris1,Stris2,Str : string;
  Intis1,Intis2,Int,Int1 : integer;
begin
  Intis1 := 1;
  Stris1 := Edit1.Text;
  Stris2 := copy(Edit2.text,1,1);
  Intis2 := length(Edit2.Text);
  for int:=1 to length(Edit1.Text) do
  begin
    if copy(Edit1.Text,Int,1)=Stris2 then
    begin
      Stris1 := copy(Edit1.Text,Int,Intis2);
      for Int1:=1 to Intis2 do
      begin
        if copy(Stris1,Int1,1)=copy(Edit2.Text,Int1,1) then
          Intis1 := 0
        else
        begin
          Intis1 := 1;
          break;
        end;
      end;
      if Intis1 = 0 then
        break;
    end;
  end;
  if Intis1 = 0 then
    showmessage('包含子字符串')
  else
    showmessage('不包含子字符串');

end;

end.

⌨️ 快捷键说明

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