0

I have the JSON string that I want to use in my C# program.

var responseBytes = "{ "class":"TPV","device":"tcp://172.19.34.3:50000","mode":3,"time":"2017-09-20T02:55:15.000Z","ept":0.005,"lat":-36.853230000,"lon":174.773626667,"alt":40.200,"epv":23.000,"track":246.3700,"speed":0.000,"climb":0.000,"epc":46.00}";

But my VisualStudio Editor is showing errors for the above decleration. It is probably because of the lack of escape characters. How do I fix this?

1
  • Hello errors being shown? Commented Sep 20, 2017 at 4:46

1 Answer 1

3

can not use " inside "" directly

to solve this use \" all quotations inside Double quotations

or use ' except " inside double Quotation

var responseBytes = "{ \"class\":\"TPV\",\"device\":\"tcp:172.19.34.3:50000\",\"mode\":3,\"time\":\"2017-09-20T02:55:15.000Z\",\"ept\":0.005,\"lat\":-36.853230000,\"lon\":174.773626667,\"alt\":40.200,\"epv\":23.000,\"track\":246.3700,\"speed\":0.000,\"climb\":0.000,\"epc\":46.00}";
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.