Autor Beitrag
JRegier
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 29.06.05 08:32 
Hallo, ich möchte ein String z.B von Pos 4 bis Ende kopieren wie mache ich das?
Ich könnte selbst eine Funktion Schreiben! Aber gibts da in Delphi fertige?

Was bei Delphi ist meiste mit PChar! Aber ich hatte früher mal versucht mit StrLCopy hatte aber Zugriffsverletzungen gemacht! In Java ist String String aber PChar ist ja was anderes! Wie bekomme ich meinen String aus PChar?
Smartie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 205



BeitragVerfasst: Mi 29.06.05 08:44 
da gibts die funktion copy

du bigst an, von welcem string, du ab dem wievielten zeichen, wie viele Zeichen rausnehmen willst

also zb

ausblenden Delphi-Quelltext
1:
2:
S_String := 'Hallo Smartie';
B_String := copy(S_String, 7, length(S_String - 6); //Ergibt Smartie


Lieben Gruß

Smartie
JRegier Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1268

Win XP Home, Prof, 2003 Server
D6 Enterprise
BeitragVerfasst: Mi 29.06.05 09:14 
user profile iconSmartie hat folgendes geschrieben:
da gibts die funktion copy

du bigst an, von welcem string, du ab dem wievielten zeichen, wie viele Zeichen rausnehmen willst

also zb

ausblenden Delphi-Quelltext
1:
2:
S_String := 'Hallo Smartie';
B_String := copy(S_String, 7, length(S_String - 6); //Ergibt Smartie


Lieben Gruß

Smartie


Oh, Vielan Dank! Die einfache Pos Funktion die mit Strings geht und nicht mit PChar ist auch einfacher
als StrPos!