Are you asking about the "Enrolled users" page in a course? If you need to be able to filter roles on that page, you could maybe define separate enrollment methods for students and teachers, and then filter by enrollment method. Otherwise, the "Participants" link in the course allows you to view users by role.
Roles and permissions
Filtering roles
This discussion has been locked so you can no longer reply to it.