CopyPastor

Detecting plagiarism made easy.

Score: 0.7964903788311491; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2013-07-11
by Hariharan

Original Post

Original - Posted on 2009-06-20
by Chris Nielsen



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Here is a list of special characters that you can escape when creating a string literal for JSON:
\b Backspace (ascii code 08) \f Form feed (ascii code 0C) \n New line \r Carriage return \t Tab \v Vertical tab \' Apostrophe or single quote \" Double quote \\ Backslash caracter
Reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Values,_variables,_and_literals?redirectlocale=en-US&redirectslug=JavaScript%2FGuide%2FValues%2C_variables%2C_and_literals#String_Literals
Here is a list of special characters that you can escape when creating a string literal for JSON:
<pre> \b Backspace (ASCII code 08) \f Form feed (ASCII code 0C) \n New line \r Carriage return \t Tab \v Vertical tab \' Apostrophe or single quote \" Double quote \\ Backslash character </pre>
Reference: [String literals][1]
Some of these are more optional than others. For instance, your string should be perfectly valid whether you escape the tab character or leave in a tab literal. You should certainly be handling the backslash and quote characters, though.
[1]: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#String_Literals "String literals"

        
Present in both answers; Present only in the new answer; Present only in the old answer;