Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi String bearbeiten. (https://www.delphipraxis.net/110779-string-bearbeiten.html)

Rifman 24. Mär 2008 19:13


String bearbeiten.
 
Hallo,

wie kann man z.B. die zwei ersten byte von einem String löschen und das dritte Byte auf Position 1 verschieben?

Danke!

Dani 24. Mär 2008 19:17

Re: String bearbeiten.
 
Mit Copy()

Delphi-Quellcode:
  S := Copy(S, 3, MaxInt);

mkinzler 24. Mär 2008 19:21

Re: String bearbeiten.
 
oder
Delphi-Quellcode:
Delete()

Klaus01 24. Mär 2008 19:22

Re: String bearbeiten.
 
Guten Abend,

ich würde da noch delete einwerfen wollen:
Zitat:

Zitat von DelphiHilfe
procedure Delete(var S: string; Index, Count:Integer);

Description

Delete removes a substring of Count characters from string S starting with S[Index]. S is a string-type variable. Index and Count are integer-type expressions.

If index is larger than the length of the S or less than 1, no characters are deleted.

If count specifies more characters than remain starting at the index, Delete removes the rest of the string. If count is less than 0, no characters are deleted.


Rifman 24. Mär 2008 19:31

Re: String bearbeiten.
 
Dankeschön! :thumb:


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:13 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz