Gossamer Forum
Home : Products : DBMan : Customization :

Splitting a string

Quote Reply
Splitting a string
Okay for what I am trying to do, I have an array of records, but it's not an array of arrays. so the records come out like this:

123|candy|i like sweets ( or something like this)

but that is just 1 record in the array, as a string. How can I split this string into a separate, temporary array?
I have tried this:

$toc=$array[0];
@temp = split (/|/, $toc);

but it doesn't seem to split and create an array. What am I doing wrong???

Quote Reply
Re: Splitting a string In reply to
You'll need to escape that pipe:
@temp = split (/\|/, $toc);

- Mark


Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Splitting a string In reply to
Darn!!!! THANKS ASTRO BOY... everythig works golden =)