3

Possible Duplicate:
How do I format my code blocks?

Hello all,

Sorry for putting this insane question but I am stuck on this since long time. Whenever I put code on stack overflow I always use "'" (single quotes) at the start and end of each line of code which is tedious and probability wrost of all available option. How can we format multiple lines of code together instead of using "'" on every line ?

I observed many other newbies also facing this same issue. Most of the time other experienced users edits the question.

Thanks,

Ajinkya.

4
  • Welcome to Stack Overflow! Please check out our FAQ (stackoverflow.com/faq) for information on posting questions. Short answer: indent each line of code by two spaces, and it will be automatically formatted for you. Commented May 21, 2011 at 13:30
  • @bob: sorry it was pre copied text which got pasted in between.
    – Ajinkya
    Commented May 21, 2011 at 13:32
  • @Bob should be 4, not two.
    – vcsjones
    Commented May 21, 2011 at 13:38
  • @vcsjones -- I know it's four spaces! I have no idea why I wrote two! :) Commented May 21, 2011 at 17:31

1 Answer 1

3

Surround inline code with back-ticks, begin blocks of code with 4 spaces or a tab. Done!

Example:

Surround inline code with `back-ticks`,...

(Preceding line begins with four spaces.)

Not the answer you're looking for? Browse other questions tagged .