[Israel.pm] splitting a string

Benrey Yosi YosiB at pelephone.co.il
Wed Sep 27 05:58:30 PDT 2006




$a="123456";
($b,$c)=(substr($a,0,length($a)/2),substr($a,length($a)/2,length($a)/2))
;




-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Levenglick Dov-RM07994
Sent: Tuesday, September 26, 2006 10:41 AM
To: Perl in Israel
Subject: Re: [Israel.pm] splitting a string

Thanks to all. 


 
Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[x] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
[ ] Personal Memorandum

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Levenglick Dov-RM07994
Sent: Tuesday, September 26, 2006 08:40
To: Perl in Israel
Subject: [Israel.pm] splitting a string

Hi,
I am looking for the most efficient and most elegant (not necessarily
the same) way of splitting a string in to chunks of a given length.
E.g. if I have a string '123456' which I want to split in to two chunks
of 3 characters, I should have ('123', '456') when done.
 
 
Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[x] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
[ ] Personal Memorandum

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl

_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl




More information about the Perl mailing list