How do you format code when posting to Yahoo Answers?

When I reply to posts on Yahoo Answers and provide code samples, I notice that long strings get truncated. This isn’t a problem with links because the links generally still work, but it’s obviously problematic when it truncates code — and users asking questions probably won’t be able to fill in the blanks. So, is there a way to format code (or any text) so that it isn’t truncated?

3 Responses to “How do you format code when posting to Yahoo Answers?”

  • Ron:

    You can provide a notice that spaces have been added, but usually that isn’t required if the spaces you insert have no effect on the overall workings of the code. It only gets truncated when you keep a lot of tags together in one long string without any space whatsoever.

    PasteBin is a better solution: http://pastebin.com/

    Ron

  • Michael:

    I don’t think there is any way. In those instances, I poste the response on pastebin.com and then link to it.

  • Ratchetr:

    No way that I’ve found, except to add some spaces in the long lines so they don’t get truncated.
    e.g. This gets truncated:
    somelongname[somelongindex+anotherlongname]
    This doesn’t:
    somelongname[ somelongindex + anotherlongname ]

Leave a Reply