Re: Substring with unknown length (newbie)
- From: "Tom de Neef" <tdeneef@xxxxxxxx>
- Date: Fri, 25 Nov 2005 17:23:21 +0100
"Lene" <lenehell@xxxxxxxxxxx> schreef in bericht
news:1132926414.542477.307870@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> that means I'll have difficulties using the 'copy' function since
> it requires length parameter.
>
> I'm trying to copy or search a string until a certain character match,
> and then null-terminate. something like (pseudo) :
>
> Search string[ i++] until string [ i] = '>';
> string [ i+1] := #0;
>
>
p:=pos(Substring,Mainstring); // eg pos('>','my string is > than yours')
returns 14
if p=0 // no Substring in Mainstring
then decide what you want to do
else s:=copy(Mainstring,1,p); // then reurns the first p chars, eg 'my
string is >'
Tom
.
- References:
- Substring with unknown length (newbie)
- From: Lene
- Substring with unknown length (newbie)
- Prev by Date: Re: creating properties with sub-properties (like TFont)
- Next by Date: Re: Substring with unknown length (newbie)
- Previous by thread: Re: Substring with unknown length (newbie)
- Next by thread: Re: Substring with unknown length (newbie)
- Index(es):
Relevant Pages
|
|