Autor Beitrag
mexx
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Fr 28.04.06 13:32 
Ich habe einen String von folgendem Format: Z für Buchstabe, z für Zeichen

ZZzZZ z


Welches ist die beste Möglichkeit die Ziffern Z von den Zeichen z zu trennen?

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 28.04.06 13:35 
Du kannst mir str[index] auf alle Zeichen des Strings zugreifen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
var str:string;

str:='blubberiblubb';
//1.Zeichen:
label1.caption:=str[1];

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
mexx Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1183



BeitragVerfasst: Fr 28.04.06 13:38 
Gänge auch

ausblenden Delphi-Quelltext
1:
str[1..2]					


um die ersten zwei Zeichen zu erhalten?

Moderiert von user profile iconGausi: Tags repariert.

_________________
Das Unsympathische an den Computern ist, dass sie nur ja oder nein sagen können, aber nicht vielleicht.
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Fr 28.04.06 13:41 
Nein, da mache das so:
ausblenden Delphi-Quelltext
1:
Copy(str,1,2);					

Ich weiß die Parameter von copy nicht auswendig, am besten schau mal in die Delphi-Hilfe unter 'Copy(Funktion)'.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Fr 28.04.06 13:41 
Dafür brauchst du Copy. Mehr dazu in der Hilfe - die Reihenfolge der Parameter werd ich mir nie merken können :lol:

Edit: Na, wenigstens bin ich da nicht alleine...

_________________
We are, we were and will not be.