Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: compare two strings and return only he unique values.

by Not_a_Number (Parson)
on Feb 03, 2013 at 22:40 UTC ( #1016872=note: print w/ replies, xml ) Need Help??


in reply to Re^2: compare two strings and return only he unique values.
in thread compare two strings and return only he unique values.

Yeah, I know. But the OP said:

I am trying to display unique values from two strings

So is 'A', in your dataset, unique or not?

Depends upon a better spec, I suppose...

Update: smls (below) already pointed this out;


Comment on Re^3: compare two strings and return only he unique values.
Re^4: compare two strings and return only he unique values.
by Kenosis (Priest) on Feb 03, 2013 at 23:34 UTC

    Your solution is elegant and works beautifully with "ABCDE", "BCDEO" -- the OP's two initial strings. But the OP later included "ABCDE", "BBBBB" as options, clearly indicating the possibility of character reptition. Quite agree that a clearer spec would help...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (16)
As of 2015-07-06 12:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (74 votes), past polls