[fpc-pascal]Splitting Strings at character

Michael Van Canneyt michael.vancanneyt at wisa.be
Mon Mar 8 16:48:07 CET 2004


On Mon, 8 Mar 2004, Taj Morton wrote:

> Hi All,
> I'm looking for a routine to create a string list from a string, with
> items being seperated with a comma (,).
>
> For example: free,pascal,OO,linux,win32
> Would create a stringlist with:
>
> free
> pascal
> OO
> linux
> win32

MyStringList.CommaText:='free,pascal,OO,linux,win32';

If there are spaces, you should enclose them in double quotes:
MyStringList.CommaText:='"free pascal","Object Oriented",linux,win32';

Michael.




More information about the fpc-pascal mailing list