我有以下的普通Expression-解析字符串C#
string s = "{\"data\": {\"words\": [{\"wordsText\": \"Three Elephants /d
in the jungle\"}]}}";
string[] words = s.Split('\\',':','[',']','{','}','"');
foreach (string word in words)
{
Console.WriteLine(word);
}
哪个输出 -
data
words
wordsText
Three Elephants /d in the jungle
什么是摆脱在输出前3行的最好的方式,使我只得到最后一行Three Elephants /d in the jungle
。
我相信如果我在"wordsText\":
之后写出所有的文字,这可能是一种可能的方法,任何帮助都非常感谢。
你是对的这是JSON,但是在.NET中使用什么库>因为它不承认JObject,我会标记为正确的。 – Ebikeneser
@Jambo使用JSON.NET库。我用一个链接更新了问题。 –
非常感谢。 – Ebikeneser