Answer the question
In order to leave comments, you need to log in
One backslash in C#?
You need to create JSON and send it to the client, in json there is a path field that should be a trace of the form:
Path1\/Path2", in the C# code I do this: path="Path1\\/Path2" but I get two dashes, I tried to put a dog before the line: @"Path1\/Path2" there were 2 backslashes, how to make one?
Answer the question
In order to leave comments, you need to log in
The second backslash is given to you by the JSON serializer, because backslash is special. character in JSON and must be escaped. If you need something like "\/" in the JSON ITSELF, don't add a backslash to the path at all. The JSON serializer will add it for you when it escapes the FORWARD slash. Those. give the serializer as is, path="Path1/Path2".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question