Re: Substring with unknown length (newbie)




"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.


.



Relevant Pages

  • Re: Separate Words
    ... >> I need to convert a mixed case string into works. ... Exp: convert ... >> do the trick? ... Prev by Date: ...
    (comp.unix.shell)
  • Substring with unknown length (newbie)
    ... I'm trying to copy or search a string until a certain character match, ... But maybe it is the syntax that is my problem. ... Prev by Date: ...
    (comp.lang.pascal.delphi.misc)
  • Re: BASS Equipment For Sale
    ... Didn't Entwistle use a 12 string in Trick of the Light? ... Prev by Date: ...
    (alt.guitar.bass)
  • Re: Dynamic doctests?
    ... Remove 'doctest.tesmod' and the import from your 'code' string. ... ]]] import doctest ... should do the trick. ... Prev by Date: ...
    (comp.lang.python)
  • Re: Problem trying to determine if a file exists using wildcard
    ... Using this method seems to have done the trick. ... >the search pattern and returns a string() containing all the files that ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)