What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 128 Stack Exchange communities.

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.

share|improve this question

migrated from stackoverflow.com May 21 '11 at 13:41

This question came from our site for professional and enthusiast programmers.

marked as duplicate by ChrisF, Kev, Cody Gray, Jon Seigel, John Saunders May 22 '11 at 1:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
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. –  Bob Kaufman May 21 '11 at 13:30
    
@bob: sorry it was pre copied text which got pasted in between. –  Ajinkya May 21 '11 at 13:32
    
@Bob should be 4, not two. –  vcsjones May 21 '11 at 13:38
    
@vcsjones -- I know it's four spaces! I have no idea why I wrote two! :) –  Bob Kaufman May 21 '11 at 17:31
add comment

1 Answer 1

up vote 2 down vote accepted

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.)

share|improve this answer
add comment

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