I have a list of strings which I need to put together in every valid combination so that the result can be used in an includes
WHERE clause of a multi-select picklist in a SOQL query. Basically, I need to go from myList
to endResult
:
List<String> myList = new List<String>{
'A','B','C','D'
};
List<String> endResult = new List<String>{
'A','A;B','A;C','A;D','A;B;C','A;B;D','A;C;D','A;B;C;D',
'B','B;C','B;D','B;C;D',
'C','C;D',
'D'
};
I've written so many fruitless loops that I broke down and decided to post here. Thanks in advance!
includes ('A', 'B', 'C', 'D')
? What specific scenario are you trying to address?