Autor Beitrag
pk910
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Do 21.09.06 13:50 
Wie kann ich einen String auf einen Satz durchsuchen?
kuddel
Hält's aus hier
Beiträge: 6



BeitragVerfasst: Do 21.09.06 14:01 
Hi,

also ich verwende für solche Sachen:

STRCON
StrCon.pas contains a TStringCollection class with a large collection of string
functions.

Status: Freeware - No restrictions apply - without a warranty of any kind.
Compiler: Delphi4,Delphi5
Version: 1.5
Lastdate: 06 April 2000
Author: Eric Grobler (egrobler@quoka.com)
Orginal help file by Gigi M. Fusi


Funktioniert übrigens auch mit Delphi 7, darüberhinaus nicht getestet.
Enthält eine große Zahl von sehr hilfreichen Stringfunktionen.

Download: z.B.: Hier
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Do 21.09.06 14:01 
schau dir mal Pos() und PosEx() an ;-)
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Do 21.09.06 14:05 
könnt ihr mir nid n beispiel geben?
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Do 21.09.06 14:07 
Hmm.....sorry, aber ein bischen eigenitiative musst du auch zeigen.
Nicht so nach dem Motto "Ich brauch ein programm - programmiert ihr mir eins?" ;-)

Gruss
Daniel
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Do 21.09.06 14:08 
aber wie funktioniert denn Pos() und PosEx() ???
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Do 21.09.06 14:12 
F1 hilft ;-)
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Do 21.09.06 14:24 
bitte :(

ich blicks nid...
wie kann ich damit nen String durchsuchen?
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 21.09.06 14:26 
Wie ist denn dein bisheriger Ansatz? Was blickst du nicht?

_________________
We are, we were and will not be.
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Do 21.09.06 14:28 
pos()

schneidet n Stück ausm String raus... wie kann ich damit was finden?
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Do 21.09.06 14:32 
Pos() schneidet kein Stück aus dem String raus. Hast du dir mal die Hilfe angeguckt? In welchem String möchtest du was suchen, und was soll gefunden werden?

_________________
We are, we were and will not be.
uwewo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 154



BeitragVerfasst: Do 21.09.06 14:44 
Sowas

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var S: string;

begin
  S := '   123,5';
  { Leerzeichen in Nullen umwandeln }
  while Pos(' ', S) > 0 do
    S[Pos(' ', S)] := '0';
end;


steht in der Hilfe, das zu finden hat ca. 5 Sek. gedauert
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Do 21.09.06 14:48 
Uns d wie will ich damit etwas Suchen

z.B.

ausblenden Delphi-Quelltext
1:
2:
string:='Hallo test hallo';
suche:='test';


also die suche sollte
ausblenden Delphi-Quelltext
1:
ergebniss:=TRUE;					

ergeben...

wie bekomme ich sowas hin?

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Do 21.09.06 14:52 
ausblenden Delphi-Quelltext
1:
2:
if pos('test','hallo test hallo') > 0 then
  ergebnis := true;


wo ist das problem?
pk910 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 74

Win VISTA, Win 98, Win XP, Linux
Delphi 5.0
BeitragVerfasst: Do 21.09.06 14:56 
ach soooo....
sorry... dann habe ich die Anleitung falsch verstanden xD vielen vielen Dank
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Do 21.09.06 15:09 
kein problem ;-)