Autor Beitrag
Robii
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236



BeitragVerfasst: Mi 17.06.09 21:54 
Hey, wie kann ich überprüfen ob ein String überhaupt ewas enthält.
Gruß.
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mi 17.06.09 21:57 
tja, mit length(trim(dein_String)) = 0 oder mit trim(dein_String) = ''. Da ich vermute das Integervergleiche zeitsparender als Stringvergleiche sind, würde ich dir zur ersten Methode raten. ;)

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
FinnO
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1331
Erhaltene Danke: 123

Mac OSX, Arch
TypeScript (Webstorm), Kotlin, Clojure (IDEA), Golang (VSCode)
BeitragVerfasst: Mi 17.06.09 22:05 
ausblenden Delphi-Quelltext
1:
if string <> '' then ...					


wäre ja wohl das einfachste, und müsste eigentlich auch das optimalste sein.
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mi 17.06.09 22:07 
hhmmm, stimmt. Leerzeichen ist ja auch ein Zeichen und deswegen ist der String dann nicht mehr leer. sorry!

aber imho ist ein vergleich mit Lenght doch zeitsparender, oder??

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Robii Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 236



BeitragVerfasst: Mi 17.06.09 22:08 
Ok Danke ;)