locked
Newlines in resjson files?

    Question

  • How to use a newline in resjson file?

    I tried

    "res_name" : "want a newline here.\\n On a new line"

    the output is "want a newline here. \n On a new line".

    I also tried

    "res_name" : "want a newline here.\n On a new line".

    the output is "want a newline here. On a new line".


    Louis

    Friday, March 02, 2012 7:42 PM

Answers

  • You will not be able to see the newline in many cases.

    What are you outputting this to?  If you do not use a resource and just the string, does it display correctly? Only certain things (line textbox with multiline turned on) can display this appropriately.

    For HTML you would want to use <br/>


    Jeff Sanders (MSFT)

    • Marked as answer by Louis_PiG Friday, March 02, 2012 8:39 PM
    Friday, March 02, 2012 7:54 PM
    Moderator

All replies

  • You will not be able to see the newline in many cases.

    What are you outputting this to?  If you do not use a resource and just the string, does it display correctly? Only certain things (line textbox with multiline turned on) can display this appropriately.

    For HTML you would want to use <br/>


    Jeff Sanders (MSFT)

    • Marked as answer by Louis_PiG Friday, March 02, 2012 8:39 PM
    Friday, March 02, 2012 7:54 PM
    Moderator
  • try \r\n ! ;-)
    • Edited by xazin Sunday, April 22, 2012 12:29 AM
    Sunday, April 22, 2012 12:22 AM