Applies to: Microsoft Teams.
To submit a code snippet in a chat or channel message, first press Format under the compose box, then click Code snippet in the format bar. This brings up a dialogue box, where you can type your code and a snippet title. Pick your preferred language to use, and decide whether you want text wrapping.
Syntax highlighting and auto-indentation aid you to compose your code in your intended format. After you send your snippet, it’s contained in the message as a card, and the recipient can see it inline with the syntax highlighting intact.
If you want to amend your code snippet when you’ve sent it, pick More options > Edit on your message, then Edit once more on the snippet card.