in reply to Challenge - Creative Way To Detect Alpha Characters
This is both perl-specific and slow, but I'll just show it:
sub isalpha { no warnings "numeric"; my($p) = @_; 0==++$p; } sub hasalpha { my($s) = @_; isalpha(substr($s, 0, 1, "")) and return 1 while length($s); return; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Challenge - Creative Way To Detect Alpha Characters
by Pragma (Scribe) on Sep 14, 2004 at 07:37 UTC | |
|
Re^2: Challenge - Creative Way To Detect Alpha Characters
by Jasper (Chaplain) on Sep 14, 2004 at 10:17 UTC | |
by ambrus (Abbot) on Sep 14, 2004 at 15:40 UTC | |
by Pragma (Scribe) on Sep 14, 2004 at 18:42 UTC |