Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Programmieren allgemein (https://www.delphipraxis.net/40-programmieren-allgemein/)
-   -   Edit kopieren (https://www.delphipraxis.net/188374-edit-kopieren.html)

DeddyH 26. Feb 2016 08:12

AW: Edit kopieren
 
Vielleicht ist so etwas gemeint (schnell heruntergetippt und nicht groß getestet)?
Delphi-Quellcode:
function StripNumbers(const sIn: string): string;
const
  NUMBERS = ['0'..'9'];
var
  i, CurrentLen: integer;
begin
  CurrentLen := 0;
  SetLength(Result, Length(sIn));
  for i := 1 to Length(sIn) do
    {$IFDEF UNICODE}
    if not CharInSet(sIn[i], NUMBERS) then
    {$ELSE}
    if not (sIn[i] in NUMBERS) then
    {$ENDIF}
      begin
        inc(CurrentLen);
        Result[CurrentLen] := sIn[i];
      end;
  SetLength(Result, CurrentLen);
end;

hoika 26. Feb 2016 08:28

AW: Edit kopieren
 
Hallo,

wie wäre es mit
Delphi-Quellcode:
StringReplace(S, '1', '', []);
StringReplace(S, '2', '', []);

usw. (für eine Schleife ist es zu früh ;) )
usw.


Heiko


Alle Zeitangaben in WEZ +1. Es ist jetzt 04:20 Uhr.
Seite 2 von 2     12   

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 by Thomas Breitkreuz