0

hi bellow is my JSON string

\"Education\":{\"EducationLevel\":[\"\"],\"WithCertification\":[\"CISCO\"]"

how can i remove this " \"EducationLevel\":[\"\"]" from my string and should get the following JSON string

\"Education\":{\"WithCertification\":[\"CISCO\"]"

and im using string filterString = JsonHelper.JsonSerializer(filters)

Sam Axe
  • 33,313
  • 9
  • 55
  • 89
user2199888
  • 211
  • 1
  • 2
  • 4

3 Answers3

1

you can use yourString.Replace() function to remove any unwanted chars or strings

Raed Alsaleh
  • 1,581
  • 9
  • 27
  • 50
0

You can take advantage of json in asp.net.
Here is a msdn link
http://msdn.microsoft.com/en-us/library/cc197957%28v=vs.95%29.aspx

More reading
Parsing JSON data with C#

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117
0

I think what @Thilo means is something like this -

        const string Test = "{\"Education\":{\"EducationLevel\":[\"\"],\"WithCertification\":[\"CISCO\"]}}";
        var deserializeObject = JsonConvert.DeserializeObject<dynamic>(Test);
        var other = new { Education = new { EducationLevel = deserializeObject.EducationLevel } };
        var serializeObject = JsonConvert.SerializeObject(other);
        Console.WriteLine(serializeObject);

Note - I am using JSON.Net

Srikanth Venugopalan
  • 9,011
  • 3
  • 36
  • 76