正在阅读:Delphi学习:2个不错的通配符比较函数Delphi学习:2个不错的通配符比较函数

2004-09-13 14:41 出处:CSDN 作者:Stanley_Xu 责任编辑:linjixiong


  Inc(aPattern);
  end;
  end;
  end else
  begin
  //Match for inclusion of given set...
  Inc(aPattern);
  Result := False;
  while (aPattern[0] <> ']') do
  begin
  if (aPattern[1] = '-') then
  begin
  //Match char inclusion range.
  if (aSource[0] >= aPattern[0]) and (aSource[0] <= aPattern[2]) then
  begin
  //Given char matched set range inclusion.
  // Continue testing...
  Result := True;
  Break;
  end else
  Inc(aPattern, 3);
  end else
  begin
  //Match individual char inclusion.
  if (aSource[0] = aPattern[0]) then
  begin
  //Given char matched set element inclusion.
  // Continue testing...
  Result := True;
  Break;
  end else
  Inc(aPattern);
  end;
  end;
  end;

  if (Result) then
  begin
  //Match was found. Continue further.
  Inc(aSource);
  //Position Pattern to char after "]"

 


察看评论详细内容 我要发表评论
作者笔名 简短内容 发表时间
:

键盘也能翻页,试试“← →”键

相关文章

关注我们

最新资讯离线随时看 聊天吐槽赢奖品