Magento 2 – How can I pull Category Names into Product Page and separate multiple Categories?

I want to pull category names into my title.phtml template. I am using the code below. It pulls in all categories. However, It does not put spaces in between the categories if the product is a part of more than one. How can I add spaces between categories here?

 <?php $  objectManager = \Magento\Framework\App\ObjectManager::getInstance(); $  product = $  objectManager->get('Magento\Framework\Registry')->registry('current_product'); $  categories = $  product->getCategoryIds(); foreach($  categories as $  category){     $  cat = $  objectManager->create('Magento\Catalog\Model\Category')->load($  category);     echo $  cat->getName();     }   ?>