I have a valid JSON shown below
{
"employees": [
{
"firstName": "Peter",
"lastName": "Jones"
}
]
}
Please let me know how can i associate this with String in Eclipse IDE
Means i want to do
String json = "{
"employees": [
{
"firstName": "Peter",
"lastName": "Jones"
}
]
}"
but its giving an compilation error , telling String literal is not properly closed by a double-quote
If the JSON string was pasted from somewhere, you might want to select the “Escape text when pasting string” option. Then you won’t have to escape by hand which can be tideous.
http://tarlogonjava.blogspot.sg/2008/04/cut-and-paste-of-strings-in-eclipse.html