Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Teil eines Strings (https://www.delphipraxis.net/8642-teil-eines-strings.html)

Moyyer 9. Sep 2003 14:08


Teil eines Strings
 
Hallo Allle Zusammen!

Ich habe einen String! z.B ('Draußen Steht ein Haus')
Wie kann ich feststellen ob in dem String z.b Das Wort Haus enthalten ist oder nicht. Weiß jem. Rat?

MFG Moyyer.

Grumble 9. Sep 2003 14:11

Re: Teil eines Strings
 
hallo

Delphi-Quellcode:
s:='Draußen Steht ein Haus';
x:=pos('Haus',s);
x gibt die stelle an an der der gesuchte teil steht
wenn also x>0 ist ist der teilstring enthalten

cu
grumble

[edit=sakura]Doppelpost gekillt. Mfg, sakura[/edit]
[edit=sakura]Den dritten jetzt auch :roll: Mfg, sakura[/edit]

svehei 9. Sep 2003 14:13

Re: Teil eines Strings
 
siehe delphi-hilfe:

PosEx function

Returns the index value of a substring.

Unit

StrUtils

Category

string handling routines

Delphi syntax:

function PosEx(const SubStr, S: string; Offset: Cardinal = 1): Integer;

C++ syntax:

extern PACKAGE int __fastcall PosEx(const AnsiString SubStr, const AnsiString S, unsigned Offset = 1);

Description

PosEx returns the index of SubStr in S, beginning the search at Offset. If Offset is 1 (default), PosEx is equivalent to Pos.

PosEx returns 0 if SubStr is not found, if Offset is greater than the length of S, or if Offset is less than 1.

sakura 9. Sep 2003 14:26

Re: Teil eines Strings
 
verschoben :arrow: Object-Pascal/Delphi Language

...:cat: ...


Alle Zeitangaben in WEZ +1. Es ist jetzt 03:37 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz