Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Do 31.03.05 07:54 
Hallo,

wie kann ich wenn ein Datenstring mehr Datensätze hat
die mit ; getrennt sind, nur den ersten von Anfang bis zum ersten ; einlesen, wo bei das erste ; nicht dabei sein darf.

Die Daten sind nämlich ein einer Fremden ListView Kombo.

Wie man items rausholt weiß ich schon nur wie man den ersten Satz bekommt nicht.

ZB:
Name;Addresse;Tel >
Ergebnis: Name

Danke sehr...


Moderiert von user profile iconraziel: Topic aus Sonstiges verschoben am Do 31.03.2005 um 11:58
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Do 31.03.05 07:59 
so ähnlich !
ausblenden Delphi-Quelltext
1:
s := copy(s,1,pos(';',s) -1);					

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.


Zuletzt bearbeitet von chrisw am Do 31.03.05 08:04, insgesamt 2-mal bearbeitet
Holgerwa
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 325

WIN XP Pro, Vista Business
Delphi 7 Pro, BDS 2006 Pro
BeitragVerfasst: Do 31.03.05 08:00 
ausblenden Delphi-Quelltext
1:
2:
3:
var s: string;
...
s := Copy (DeinString, 1, Pos (';', DeinString) - 1);

Holger
Stübi
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 331

Win XP, Win 2000, Win ME
D5 Ent, D7 Prof, D2005 PE, C#
BeitragVerfasst: Do 31.03.05 08:00 
Hallo

Versuchs mal mis pos, delete und copy sind alles Stringmanipulationen (stimmt das Wort??)

Gruss Stübi

_________________
Neun von zehn Stimmen in meinen Kopf sagen, dass ich nicht verrückt sei. Die zehnte summt die Tetrismelodie.
demo88
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 160

Ubuntu 6.04, Win XP
Delphi 7
BeitragVerfasst: Do 31.03.05 10:08 
3 Programmierer 1 Gedanke :rofl:
Biarchiv Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Mi 06.04.05 16:19 
Hallo,

danke hat wunderbar geklappt.
wie geht es von hinten nach vorn?

es kann aber vorkommen das die letzt Stringstelle schon ein
; ist.

ZB:
stest;1;sdfdfds;44 > 44
dfsde;asffd;; > [nichts leerer String]

Danke