Hi!
I bet this one is simple, but I just don't seem to get it. The thing is ... there is a string of characters stored in a variable that I want to loop through - get a character one by one including spaces and so on.
I tried something like I used to do with JavaScript but it just doesn't work.
Code:
for (my $key = 0; $key < length($word); $key++) {
print substr ($letter, $key, $key + 1)."\n";
}
let us say that the string is 1234567890, then the output goes like this:
1
23
345
4567
56789
67890
7890
890
90
0
weird .... in JavaScript with substring() it works fine. Any ideas??
Thanks
lfur