We can get Current website code programmatically using Magento 2 by StoreManagerInterface.
By default, Single website have default assigned code is “default”
If you are working with multiple website eCommerce stores, You need to fetch current website code for respected website programmatically on some occasion.
