Autor Beitrag
Thunderwave
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35



BeitragVerfasst: Di 28.03.06 21:28 
Is bestimmt ganz einfach (genau wie beim letzten mal :? ):
ich habe 'f(x)=y' (y steht für irgenteine variable funktion, die sonst an dieser stelle steht) und möchte das das 'f(x)' "rausgeschnitten" wird, sodass in dem string nur noch 'y' steht. Wie ist das am einfachsten möglich? Ich habe keine ahnung!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 28.03.06 21:30 
Schau mal nach Pos oder StrScan.

_________________
Markus Kinzler.
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 28.03.06 21:33 
das geht viel einfacher ;)

ausblenden Delphi-Quelltext
1:
2:
  s := 'f(x)=y'
  Delete(s,1,5);


Zuletzt bearbeitet von Marc. am Di 28.03.06 21:48, insgesamt 1-mal bearbeitet
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 28.03.06 21:37 
Aber auch nur wenn der string genau so lautet. Wenn dan aber f2(x)=y steht funktioniert es schon nicht mehr.

s2 := (StrScan (PChar( s), '=') + 1);

_________________
Markus Kinzler.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 28.03.06 21:38 
Hallo,

nicht so einfach aber variabler :wink:
ausblenden Delphi-Quelltext
1:
2:
s := 'f(xxx)=y';
Delete(s,1,LastDelimiter('=',s));

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Thunderwave Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35



BeitragVerfasst: Di 28.03.06 21:39 
danke! genial!