I have a List of sObjects (User) and need to put the ID of each record in this List into a separate List of type String.
I found this related question and answer, but this puts the ID into a Set (I need it into a List) - the code from this that's not working is below.
List<User> users = [SELECT Id, Name, ContactId FROM User];
List<String> userIds = (new Map<Id,User>(users)).keySet();
Thanks in advance for your assistance.