How to get a store in Magento 2 programmatically?

Magento 2 Development

In Magento 1, you can get a store and the current store programmatically quite simple:

As for Magento 2, the procedure looks as follows:

Source

More tips from Magento 2 cookbook