One very cool feature I recently discovered was the ability to send snippets of code in Microsoft Teams where the formatting is preserved and even enhanced with syntax highlighting, the option to wrap text, and more!
In any message box, click the “Formatting” button:
Then select the “code snippet” button (</>):
Paste your code snippet and give it a title. You can also select the type of code you’re working with:
Select Insert to see it in the message window:
From here it can easily be referenced, expanded, and copied: