Reputation: 1309
I have below text and I want to extract Comment allez-vous from below text how do I extract using C# ?. This text will be different all the time. rest of the data format is the same.
handleResponse({
"data": {
"translations": [
{
"translatedText": "Comment allez-vous"
}
]
}
}
);
Upvotes: 0
Views: 254
Reputation: 13882
Look for last index of ". index A
Find first index for translatedText + length of translatedText +1. index B
fetch all string betwee B and A.
Upvotes: 0
Reputation: 301527
It's JSON. Use a JSON parser for .Net like JSON.NET or the JavaScriptSerializer
Upvotes: 3