Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Challenge - Creative Way To Detect Alpha Characters

by parv (Parson)
on Sep 13, 2004 at 19:44 UTC ( [id://390649]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://390649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2024-04-24 00:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found