Board index » delphi » Help manipulating strings in Delphi

Help manipulating strings in Delphi

I used to use substr function in objectPal to extract a protion of a string
from any position a especific number of character into an other string.
How can I do this in ObjectPascal.

What I want to do, is to separate a strings of strings delimited by ";" and
put them in a TStrings object.

Jos E. / j...@telcel.net.ve

 

Re:Help manipulating strings in Delphi


On Tue, 3 Nov 1998 08:02:43 -0400, "Jos E. ALvarez C."

Quote
<j...@telcel.net.ve> wrote:
>I used to use substr function in objectPal to extract a protion of a string
>from any position a especific number of character into an other string.
>How can I do this in ObjectPascal.

>What I want to do, is to separate a strings of strings delimited by ";" and
>put them in a TStrings object.

>Jos E. / j...@telcel.net.ve

Try something like this:
 Insert(Copy(Source,Pos,Index),Target,Loc);

Re:Help manipulating strings in Delphi


Jos E. ALvarez C. wrote in message <0sC%1.343$cN6.47@news01>...

Quote
>I used to use substr function in objectPal to extract a protion of a string
>from any position a especific number of character into an other string.
>How can I do this in ObjectPascal.

>What I want to do, is to separate a strings of strings delimited by ";" and
>put them in a TStrings object.

Look closely at the CommaText property of TStrings. Perhaps the delimiter
(comma "," in the USA) will be a semi-colon ";" for you.  If not, it may be
easier to change all your ";" into "," and then use the CommaText property.

Re:Help manipulating strings in Delphi


In article <0sC%1.343$cN6.47@news01>, "Jos E. ALvarez C." <j...@telcel.net.ve>
writes:

Quote
>I used to use substr function in objectPal to extract a protion of a string
>from any position a especific number of character into an other string.
>How can I do this in ObjectPascal.

>What I want to do, is to separate a strings of strings delimited by ";" and
>put them in a TStrings object.

Look up "string-handling routines" and then choose the Pascal topic in Delphi
help index

Alan Lloyd
alangll...@aol.com

Re:Help manipulating strings in Delphi


Jos,

Use Pos(), Copy(), and Delete().

Ken
--
Ken White

Clipper Functions for Delphi
http://members.aol.com/clipfunc

Jos E. ALvarez C. wrote:

Quote

> I used to use substr function in objectPal to extract a protion of a string
> from any position a especific number of character into an other string.
> How can I do this in ObjectPascal.

> What I want to do, is to separate a strings of strings delimited by ";" and
> put them in a TStrings object.

> Jos E. / j...@telcel.net.ve

Other Threads