dharanivasan has asked for the wisdom of the Perl Monks concerning the following question:
Is there any other way to do this ?use strict; use warnings; my $string = "Hello World"; my ($index,$a)= 0; for( ; $a = substr($string,$index,1) ; $index++) { print $a."\n"; }
<? $string = "Hello World; echo $string{6}; ?>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to get each character in string value
by Punitha (Priest) on Dec 02, 2008 at 07:08 UTC | |
by linuxer (Curate) on Dec 02, 2008 at 09:26 UTC | |
|
Re: How to get each character in string value
by poolpi (Hermit) on Dec 02, 2008 at 09:45 UTC | |
by spmlingam (Scribe) on Dec 02, 2008 at 11:06 UTC | |
|
Re: How to get each character in string value
by apl (Monsignor) on Dec 02, 2008 at 13:09 UTC | |
|
Re: How to get each character in string value
by QM (Parson) on Dec 04, 2008 at 05:06 UTC | |
|
Re: How to get each character in string value
by repellent (Priest) on Dec 02, 2008 at 19:47 UTC |