Set<String> accountNames = new Set<String>{'%Sam%', '%App%', '%Len%','%Nok%'};
List<Account> accList = [Select Id, Name From Account Where Name LIKE :accountNames];
List Collection in Like:
List<String> accountNameList = new List<String>{'%Sam%', '%App%', '%Len%','%Nok%'};
List<Account> accList = [Select Id, Name From Account Where Name LIKE :accountNameList];
//List of string variable
List<String> objList = new List<String>();
//Set of string variable
Set<String> objSet = new Set<String>();
objList.add('A');
objList.add('B');
objList.add('C');
//Use addAll() to add list of string to Set
objSet.addAll(objList);
//Or Use Set Constructor
Set<String> objSetData = new Set<String>(objList);
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject