Re: Substring with unknown length (newbie)
- From: "Bruce Roberts" <dontsendtober@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 25 Nov 2005 11:25:36 -0500
"Lene" <lenehell@xxxxxxxxxxx> wrote in message
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;
>
> Maybe I'll obtain a substring merely by inserting a null
> character in the source string.
You could.
> But maybe it is the syntax that is my problem.
theSubString := Copy (theString, 1, Pos (theCharacter, theString) - 1);
should do the trick.
.
- References:
- Substring with unknown length (newbie)
- From: Lene
- Substring with unknown length (newbie)
- Prev by Date: Re: Substring with unknown length (newbie)
- 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
|
|