教你一个简单的方法 用这个函数 StringReplace +一个自定义函数 SplitStringprocedure SplitString(var SL: TStringList; Source, Deli: string);var EndOfCurrentString: byte;begin Sl.Clear; while Pos(Deli, Source) > 0 do begin EndOfCurrentString := Pos(Deli, Source); Sl.add(Trim(Copy(Source, 1, EndOfCurrentString - 1))); Source := Copy(Source, EndOfCurrentString + length(Deli), length(Source) - EndOfCurrentString); end; Sl.Add(Trim(source));end;procedure TForm1.btn_FJClick(Sender: TObject);var SLF: TStringList; SLL: TStringList; FGF: string; i: Integer;begin mmo_2.Clear; FGF := '~~'; SLF := TStringList.Create; try SLL := TStringList.Create; try SLF.Text := Self.mmo_1.Text; SLF.Text := StringReplace(SLF.Text, #13#10, '', [rfReplaceAll, rfIgnoreCase]); SLF.Text := StringReplace(SLF.Text, '<font color=red>', '', [rfReplaceAll, rfIgnoreCase]); SLF.Text := StringReplace(SLF.Text, '</font>', '', [rfReplaceAll, rfIgnoreCase]); SLF.Text := StringReplace(SLF.Text, '<td>', '', [rfReplaceAll, rfIgnoreCase]); SLF.Text := StringReplace(SLF.Text, '</td>', '~~', [rfReplaceAll, rfIgnoreCase]); SLF.Text := StringReplace(SLF.Text, '<tr align="center" bgcolor="#F0EFEE">', '', [rfReplaceAll, rfIgnoreCase]); SLF.Text := StringReplace(SLF.Text, '</TR>', #13#10, [rfReplaceAll, rfIgnoreCase]); for i := 0 to SLF.Count - 1 do begin SLL.Clear; SplitString(SLL, SLF.Strings, FGF); if SLL.Count >= 9 then begin mmo_2.Lines.Add(Trim(SLL.Strings[1])); end; end; finally SLL.Free; end; finally SLF.Free; end;end;