Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 157 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

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