Search code examples
actionscript-3flash-cs5

How to add more then one space (whitespaces?) in a string?


I'm looking, for various almost mystical reasons, to have a string containing more than one spaces. Basically, I want to be able to have a text string that, when compiled into an SWF, will show "     ".

I'm sure it is possible but... How?


Solution

  • If your string is within an xml document, you might want to set XML.ignoreWhitespace=true; and XML.prettyPrinting=false;

    This will ensure that any whitespace (spaces, tabs and line breaks) are not compressed to a single space.

    It also helps to have <![CDATA[ ]]> tags around your text, in some cases.