I have two multiselect picklists Assume -
First__c and Second__c
I want to check if there is any common string between them
e.g. First__c = 'First,Second,Third';
Second__c='Nine,Four,Second,Six';
Here 'Second' this string is selected in both the picklists.
YES I CAN DO IT USING FOR LOOP and spliting string like -
List<String> lstFirst= new List<String>();
lstFirst=obj.First__c.split(',');
for(String s : lstFirst){
if(s.contains(obj.Second__c){
----My Task-------
}
}
but since I have too many such picklists I dont want to use for loops and if() which will increase my LOC and Nested for's since this logic goes in between other code.
Any Suggestions ??