Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: number of unique characters in a string

by BrowserUk (Patriarch)
on Mar 01, 2003 at 05:28 UTC ( [id://239662]=note: print w/replies, xml ) Need Help??


in reply to Re: number of unique characters in a string
in thread number of unique characters in a string

You could replace the s/// with tr///s

sub f { my $txt = join('', sort(split //,shift)); $txt =~ tr/\x00-\xff//s; return length($txt); }

Examine what is said, not who speaks.
1) When a distinguished but elderly scientist states that something is possible, he is almost certainly right. When he states that something is impossible, he is very probably wrong.
2) The only way of discovering the limits of the possible is to venture a little way past them into the impossible
3) Any sufficiently advanced technology is indistinguishable from magic.
Arthur C. Clarke.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-20 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found