in reply to How do I capture the last character in a string?
#!/usr/bin/perl -w use strict; my $string = "This is a string"; my $char = (unpack("a", reverse $string))[0]; print $char;
No, not faster, or shorter, just Another Way :-P
Arjen
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I capture the last character in a string?
by Aristotle (Chancellor) on Apr 30, 2003 at 14:53 UTC | |
|
Re: Re: How do I capture the last character in a string?
by TVSET (Chaplain) on Apr 30, 2003 at 17:09 UTC |