I need to take two SelectOption lists and create a third one which will be composed of the values which are in both lists.
I'm having trouble figuring out how to properly compare them in this code I have.
I've left out a good portion of the code in order to try and simplify it.
I need to compare the selectedSubs2 list to the getkeyTechValues list.
Here is the code :
selectedSubs2 = new list<SelectOption>();
String[] selectedvalues = selectedkeys.split(',');
for (String selectedvalue: selectedvalues)
{
selectedSubs2.add(new SelectOption(selectedvalue,selectedvalue));
}
public List<SelectOption> getkeyTechValues()
{
List<SelectOption> options=new List<SelectOption>();
options.add(new SelectOption('--None--','--None--'));
String[] picklistlines =new String[]{};
for (String item : selectedMulPickKeyTech.split(',') )
{
if (!selectedItems.contains(item))
{
//add it to your iist
options.add(new SelectOption(item,item));
}
}
return options;
}
}
//somehow I need to compare the selectedSubs2 list to the getkeyTechValues
//and make a 3rd SelectOption list of only the values which are in both
Thank you very much for your help. I really appreciate it.