+ Start a Discussion

apex How to revrieve user name from public groups

I need help in retrieveng the user name from a public group in apex code.  This code retrieves the groups base on the group name:
List<Group> g = [SELECT (select userOrGroupId from groupMembers) FROM group WHERE Name =: districtApprovalGpName];

Now I am trying to get to the User Names in the groups.  I am able to get to the GroupId, Id, and UserOrGroupId but need to know how to use that information to get to the User Names in the group.  Any and all help is appreciated.
Here is something you can refer to: