Retrieve list of all stores programmatically in Magento 2.

Get list of all the stores in a system Programmatically Magento 2.

Store contains the information regarding, store_id, code, website_id, group_id, name, sort_order and is_active.

You can see all the list from the database table name, store

Interface Provides the functionality:
Magento\Store\Api\StoreRepositoryInterface

Fetch all the store using iterate over a loop from the method,

Output: Array of all the store list in the system.