Begin doorgestuurd bericht:

Van: Eelco Alosery <[EMAIL PROTECTED]>
Datum: maa, 18 aug 2003  22:14:57 Europe/Amsterdam
Aan: Morbus Iff <[EMAIL PROTECTED]>
Onderwerp: Antw.: [MacPerl-AnyPerl] Spliting a string

Thaks for your reply,

But the string i want to read is from a cookie and i have put the string i $string

The string lengt cab be varius lengts, not hust 3 text fields or 7 but also more or less.



Morbus Iff heeft op maandag, 18 aug 2003 om 22:07 (Europe/Amsterdam) het volgende geschreven:

>I want to split a string into servral partsThe string starts whith ##
>than the text and than again ## but the string lent is not a fixed sise.


>##text1##text2##text3##
>##text1##text2##text3##text4##text5##text6##text7##

my (@splits) = split(/##/, $_);
print $splits[1]; # text1
print $splits[2]; # text2
print $splits[3]; # text3
print $splits[4] if defined $splits[4]; # text4
print $splits[5] if defined $splits[5]; # text5
.
.
.


-- Morbus Iff ( i put the demon back in codemonkey ) Culture: http://www.disobey.com/ and http://www.gamegrene.com/ Buy My Book! http://amazon.com/exec/obidos/ASIN/0596004605/disobeycom icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus





Reply via email to