enthuguy
asked on
compare two variables and get common values
Hi
I have a comma separated values in two variables, would like to compare both variables and get values which are available in both variables.
what we are expecting in the final variable as below..since they are in both.
thanks in advance
I have a comma separated values in two variables, would like to compare both variables and get values which are available in both variables.
leftString="ami-06bc7b1fd6d88be49,ami-04db3b64b5f3990dd,ami-0063dd4d697377715,ami-01f8ea3141121cda4,ami-083a15980f7fcf2ad,ami-0b22b5f710211"
rightstring="ami-023d322923f1bb271,ami-0390dfc7d966ce65d,ami-04db3b64b5f3990dd,ami-05f492333c31e3971,ami-066e692403bb98cd3,ami-06bc7b1fd6d88be49,ami-07ebe2d3da06f1831,ami-0a621c6a67fc67a3f,ami-0afa5ade0d61726ef,ami-0b41712d2aef56be1,ami-0f0b1e112bdf5034f"
what we are expecting in the final variable as below..since they are in both.
compareString="ami-06bc7b1fd6d88be49,ami-04db3b64b5f3990dd"
thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks very much, that was very helpful
ASKER
Open in new window