Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi String teilen (https://www.delphipraxis.net/19660-string-teilen.html)

titus 6. Apr 2004 18:58


String teilen
 
Hi, wie kann ich einen String an einem Punk (.) teilen?

BSP: ich möchte diesen String: "Nr1b. Inhalt" ab dem Punkt teilen und dann nur noch Inhalt ausgeben lassen...

plz help me

mfG, LCD :cyclops:

neolithos 6. Apr 2004 19:00

Re: String teilen
 
Ich würde das so gestalten.

Delphi-Quellcode:
var iPos : Integer;

iPos := Pos('.', sText);
if iPos = 0 then
   // kein Punkt, was nu
else
   sInhalt := Trim(Copy(sText, iPos + 1, MaxInt));

titus 6. Apr 2004 19:03

Re: String teilen
 
thx, genau das suchte ich :thuimb:

mfG, LCD :corky:


Alle Zeitangaben in WEZ +1. Es ist jetzt 18:58 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