Autor Beitrag
qball
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 47



BeitragVerfasst: Sa 26.04.03 10:21 
hi

wie kann ich prüfen ob ein bestimmter string in einer stringlist vertreten ist? :roll:

special-thx!
LCS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1305
Erhaltene Danke: 1

WIN 7, WIN 8
Delphi XE5, Delphi XE, Delphi 2007
BeitragVerfasst: Sa 26.04.03 10:54 
Hi
Delphi Onlinehilfe hat folgendes geschrieben:

Die Methode IndexOf gibt die Position eines Strings in der Liste zurück.

function IndexOf(const S: string): Integer; override;

Beschreibung

Mit IndexOf können Sie das erste Vorkommen eines Strings, der mit dem String S übereinstimmt, ermitteln. Ein String stimmt mit S überein, wenn er mit S identisch ist oder – wenn CaseSensitiveFalse ist – sich nur bezüglich der Groß-/Kleinschreibung von S unterscheidet.

IndexOf gibt den auf Null basierenden Index des Strings zurück. Wenn S also mit dem ersten String in der Liste übereinstimmt, liefert IndexOf 0 zurück, beim zweiten String 1 usw. Ist keine Übereinstimmung vorhanden, gibt IndexOf -1 zurück.


Gruss Lothar

_________________
Der BH ist für die Brust, der Plan ist für'n Ar...
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 26.04.03 15:16 
und wenn du einen unterstring in einem string der stringliste suchst nimmst du pos

_________________
In the beginning was the word.
And the word was content-type: text/plain.