Autor Beitrag
SteheAufDerLeitung
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 104



BeitragVerfasst: Do 30.08.07 12:07 
Hallo!

Hab einen String und möchte überprüfen, ob Operatoren enthalten sind. Dazu wollt ich mit einer Menge an Zeichen ( <, >, =, | und <>) einen Zeichensatz definiere. Geht sowas? Wenn ja, wie ist dieser dann anzuwenden? Also gibts ne Funktion 'DoesStringContainCharacterOfCharacterSet(string, characterset)'? :-D :-D

Grüße ausm kaltsonnigen Frankfurt..

Sebastian
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: Do 30.08.07 12:45 
klar geht das. dazu machst du ein array, füllst es mit dem zeug, machst ne eigene function die dir sagt ob das drin ist.

lg elundril
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 30.08.07 12:48 
Moin!

Ich würde mir ein const set of Chardefinieren und dann den String zeichenweise mit Str[i] in MyCharsprüfen. :idea:

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
SteheAufDerLeitung Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 104



BeitragVerfasst: Do 30.08.07 12:53 
Keine schlechten Ideen - an das Array hab ich auch schon gedacht - allerdings in Form von ner StringList..

Ein set of character? Kann darin '<>' aufgenommen werden? Der Operator besteht doch aus zwei charactern, oder?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 30.08.07 13:08 
Moin!

user profile iconSteheAufDerLeitung hat folgendes geschrieben:
Ein set of character? Kann darin '<>' aufgenommen werden? Der Operator besteht doch aus zwei charactern, oder?

Nein, natürlich nicht; aber du hast doch < und >... ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Shorty
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 107

Win XP, Ubuntu 8.04
Delphi 7 Prof., Delphi 2005 Pers.
BeitragVerfasst: Do 30.08.07 16:47 
Ansonsten könnte man auch mit der Pos-Funktion nach <>, ist eventuell unkomplizierter :wink:
Jakob_Ullmann
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1747
Erhaltene Danke: 15

Win 7, *Ubuntu GNU/Linux*
*Anjuta* (C, C++, Python), Geany (Vala), Lazarus (Pascal), Eclipse (Java)
BeitragVerfasst: Do 30.08.07 17:51 
Char ist ein einzelnes Zeichen. Ein String sind mehrere Chars. Wenn du in einem String ein einzelnes Zeichen ansprechen willst, geht das mit z.B. String[Zeichennummer]. Das was du brauchst ist glaube ich ein set of string.
Shorty
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 107

Win XP, Ubuntu 8.04
Delphi 7 Prof., Delphi 2005 Pers.
BeitragVerfasst: Do 30.08.07 18:21 
user profile iconJakob_Ullmann hat folgendes geschrieben:
Das was du brauchst ist glaube ich ein set of string.
Leider falsch geglaubt, ein Set funktioniert nur in Verbindung mit ordinalen Typen, also z.B. Integer oder Char.