in reply to String extraction
or$string =~ /^(.)/; $first_char = $1;
or@chars = split //, $string; $first_char = @chars[0];
but, in general, substr is the better option.$first_char = unpack 'a', $string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: String extraction
by FunkyMonk (Bishop) on Aug 30, 2007 at 23:00 UTC |