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 - Arrayelement zerlegen (https://www.delphipraxis.net/96812-string-arrayelement-zerlegen.html)

vanilla 31. Jul 2007 08:23


String - Arrayelement zerlegen
 
hallo,

ich habe ein 2D array und ein element sieht z. B. so aus

a[x,0] = 'abc = 123'

jetzt will ich diesen string zerlegen, ich brauche einmal den teil vor dem istgleich zeichen und dann den teil danach.
ich versuche das einfach mit den string fkten pos und copy zu lösen, aber es klappt nicht, kann mir jemand sagen was ich falsch mache :gruebel:

Delphi-Quellcode:
//123
wert := copy( a[x,0], pos('=', a[x,0]), ( Length(a[x,0]) - pox('=', a[x,0]-1) ) );
bei pos bringt er ne fehlermeldung operator oder semikolon fehlt ?????

sirius 31. Jul 2007 08:26

Re: String - Arrayelement zerlegen
 
Delphi-Quellcode:
wert := copy( a[x,0], pos('=', a[x,0]), ( Length(a[x,0]) - pox('=', a[x,0]) -1 ) );
Du musst die "-1" aus dem Pos rausziehen.


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