This will snag any character, including embedded tabs, newlines, etc, etc. However, it is not as efficient as using substr (substr is a bit more than twice as fast in my tests).$_="Hello World!"; $_ =~ /^(.)/; print "The first character is: $1\n";
In reply to Re: first char of string?
by Anonymous Monk
in thread first char of string?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |