develooper Front page | perl.macperl.anyperl | Postings from August 2003

Fwd: [MacPerl-AnyPerl] Spliting a string

From:
Eelco Alosery
Date:
August 18, 2003 14:34
Subject:
Fwd: [MacPerl-AnyPerl] Spliting a string
Message ID:
B9130679-D1C3-11D7-8092-000A957B8576@multi-graphics.nl


Begin doorgestuurd bericht:

> Van: Eelco Alosery <info@multi-graphics.nl>
> Datum: maa, 18 aug 2003  22:14:57 Europe/Amsterdam
> Aan: Morbus Iff <morbus@disobey.com>
> 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
>>
>




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About