Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Unique List of Common Characters Between Two Strings

by sleepingsquirrel (Chaplain)
on Jan 11, 2005 at 22:38 UTC ( [id://421451]=note: print w/replies, xml ) Need Help??


in reply to Unique List of Common Characters Between Two Strings

Or, if you're a regex fan, you might like...
sub In_Common2 { my ($str1, $str2) = @_; (my $common = reverse $str2) =~ s/[^$str1]|(.)(?=.*\1)//g; return scalar reverse $common; }


-- All code is 100% tested and functional unless otherwise noted.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-24 07:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found