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

I would like to put a string of spaces in code in an SO answer:

ddl1.Items.Add("12         34")

Without code, I can use  . In code, I cannot:

ddl1.Items.Add("12         34")

And, in code, these six spaces collapse into one:

ddl1.Items.Add("12 34")

Is there a way to show a string of spaces in code mode?

share|improve this question
    
In code, these six spaces collapse into one. In my experience, they don't. Are you positive you're using code blocks (four leading spaces) and not another type of formatting? –  Frédéric Hamidi Jan 25 '13 at 8:00
    
That's the solution! It collapses when you use backward quotes for the code, but not in an indented code block. Is that intentional? –  xpda Jan 25 '13 at 8:02
    
I believe so. Backticks are used for inline code spans (function or variable names in a sentence, for instance), preserving whitespace is not their primary goal. –  Frédéric Hamidi Jan 25 '13 at 8:05

1 Answer 1

up vote 2 down vote accepted

You can do it using four space markdown like this:

ddl1.Items.Add("12      34")
share|improve this answer

You must log in to answer this question.

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