I have a problem removing the char \ from a string containing multiple of these chars.
What i do is:
string oldString = "{\"data\": [{\"name\": \"Test User Two\",\"id\": \"138488723160636\"}]}";
string newString = oldString.Replace(@"\", "");
This does not work. On the other hand the following does work:
string test = "fafeaeaetrt";
string newString = test.Replace(@"a", "");
Besides this i have tried almost every solution in the following thread, nothing works: Remove '\' char from string c#
I know that there is something that i must have misunderstood about this :)
Can you tell me what and how i remove the character \ ?
EDIT:
But the JSON does not seem to work. I have a unit test that returns this json when the method _fbClient.Client.Get("/me/friends"); is called. See below
dynamic friendListData = _fbClient.Client.Get("/me/friends");
foreach (dynamic friend in friendListData.data)
{
friendsFacebookIds.Add(Convert.ToInt64(friend.id));
}
When i try to access the data i get the exception message: 'string' does not contain a definition for 'data'
Thought it had something to do with the backslashes since this JSON validates to be valid using a online validator and removing the backslashes.