|
|
how to process each character in a string? - Perl
|
Views : 254
|
|
Tagged in : Perl
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
If you want to put each character from your string into an array (and presumably work on them some more), you'd take an approach like this:
# our string
$string = 'Four score and seven years ago our fathers';
# split the string into an array of characters
@array = split(//, $string);
# print the contents of our perl array
print "@array";
|
|
By Nithya, On - 2010-02-04 |
|
|
|