AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Kommentare aus einem CSS-Code löschen

Offene Frage von "torud"
Ein Thema von torud · begonnen am 7. Jul 2004 · letzter Beitrag vom 13. Okt 2004
Antwort Antwort
torud

Registriert seit: 26. Jul 2002
Ort: Sachsen
1.198 Beiträge
 
Delphi XE5 Professional
 
#1

Re: Kommentare aus einem CSS-Code löschen

  Alt 8. Okt 2004, 09:18
ok, und hier kommt mein code. ich hoffe, es ist einigermaßen durchschaubar.

Delphi-Quellcode:
function ClearCommentarTStrings(Inhalt:TStrings):String;
var
  i,beg_com,end_com:integer;
  myInhalt:string;
begin
  CommentCount:=0;
  for i:=0 to Inhalt.Count -1 do
    begin
       myInhalt:=myInhalt + Inhalt.Strings[i]
    end;
  myInhalt:=Trim(myInhalt);
  while (Pos('/*',myInhalt)) > -1 do
    begin
      beg_com:=Pos('/*',myInhalt);
      end_com:=Pos('*/',myInhalt);
      if beg_com > 0 then
        begin
          if end_com > 0 then
            begin
              CommentCount := CommentCount + 1;
              delete(myInhalt,beg_com,end_com-beg_com+2);
            end
          else
            begin
              Result:=myInhalt;
              exit;
            end;
        end
      else
        begin
          Result:=myInhalt;
          
          exit;
        end;
    end;
end;
Danke
Tom
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:42 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz