0

I have a text something like this:

Text in pastebin.

altough my text will be significantly larger with multiple items. as you can see in the above text there is a textDisplay entry which will appear in every single item. is there a way to get the text inside the textDisplay "variable" from all items? I've tried with Json but had not luck. Also tried to get the text between textDisplay and the comma something like:

string data = getBetween(text, "textDisplay", ",");

but it only read the first one.

Thank you

melvas
  • 2,346
  • 25
  • 29
Maylo
  • 572
  • 5
  • 16

1 Answers1

1

If you want to get all data and map it to the models or only specific values, you should to use something like Newtonsoft.Json. See links below:

How to get some values from a JSON string in C#?

C# Parsing JSON array of objects

I hope it will help you to solve your problem.

EDIT

I've tried with Json but had not luck

Maybe problem is in JSON you try to parse? The block that you show is broken: it should be end with }]} to be valid: FIXED ONE.

Community
  • 1
  • 1
melvas
  • 2,346
  • 25
  • 29