in reply to Challenge - Creative Way To Detect Alpha Characters

It would be hard to suggest a solution w/o knowing the capabilities of that language. Does it support index() like function? Can it convert between hex and decimal values? OTOH, would a solution in perl do?

UPDATE: I decided to give a perl solution anyway. Use index() in a loop (similar to CombatSquirrel's reply and possibly slower) ...

sub has_alpha { my $string = shift; return scalar map { index($string , $_) == -1 ? () : 1 } ('a' .. 'z' , 'A' .. 'Z') ; }

Replies are listed 'Best First'.
Re^2: Challenge - Creative Way To Detect Alpha Characters
by Limbic~Region (Chancellor) on Sep 13, 2004 at 19:53 UTC
    parv,
    Heh - I don't know the language myself except from what code I saw as supplemental information in the very long and boring meeting. I was going for a Perl solution by handi-capping it by not allowing regexes.

    Cheers - L~R