AGB  ·  Datenschutz  ·  Impressum  







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

replace string with spaces?

Ein Thema von direktor · begonnen am 19. Jan 2020 · letzter Beitrag vom 20. Jan 2020
 
Benutzerbild von Dalai
Dalai

Registriert seit: 9. Apr 2006
1.684 Beiträge
 
Delphi 5 Professional
 
#9

AW: replace string with spaces?

  Alt 19. Jan 2020, 16:51
But not in Delphi 6.
Yes, it does. I just tested it in Delphi 5:
Delphi-Quellcode:
program Project1;
{$APPTYPE CONSOLE}
uses
  sysutils,
  classes;

var
   tmpstr: TStringList;
   s: string;

begin
  tmpstr:= TStringList.Create;
  try
    tmpstr.LoadFromFile('c:\boot.ini');
    s:= StringReplace(tmpstr.Text, 'boot loader', 'boot blubber', [rfReplaceAll]);
    WriteLn(s);
  finally
    tmpstr.Free;
  end;
  ReadLn;
end.
works just fine in Windows 2000 and replaces 'boot loader' with 'boot blubber'. If you really use the code from post #5 above, it's no wonder it doesn't work because you don't assign the result of the StringReplace function to anything.

Regards
Dalai
  Mit Zitat antworten Zitat
 


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 06:38 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