How do I share lovely-looking, colourful code?

I’d really like to be able to share code in the format that some posters seem to, where it shows VS-style colour-codes for variables and whatnot. But I’m struggling to see how to do that. It’s so common that there must be something obvious, but I’ve missed it. Sorry. I tried doing it by quoting another person’s post, but that didn’t seem to work, and I had a little DuckDuckGo but couldn’t get much sense. I figured it’s probably a tag or something else that’s so obvious and unspoken no one would think to explain it! :slight_smile:

Can anyone point me in the direction of this?

I too struggled with figuring this out when I started out.
Just place your c# code within a pair of triple backticks. (```) . I make sure both the sets of triple backticks are on their own separate line. See an example of the sort of text you would type in and the resulting formatted outputs below .

```
class Aclass{
void looper(){
for(int a = 0; a < 10;a++){
// A comment
}
}
}
```

class Aclass{
  void looper(){
     for(int a = 0; a < 10;a++){
         // A comment
     }
  }
}

Thanks a million, @codermonk!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms