Magento 2, You can fetch website code by just passing store id value.
You required store id to get website code from the passed store id.
You can fetch website code using the below code snippet, Continue reading “Get Website code by store id programmatically magento 2.”