更新时间:2021-09-15 21:59:50
它看起来像字符串包含在一个单一的 MyStok
对象的数组。如果从输入的两端去掉括号,你应该能够反序列化数据作为单个对象:
It looks like the string contains an array with a single MyStok
object in it. If you remove square brackets from both ends of the input, you should be able to deserialize the data as a single object:
MyStok myobj = JSON.Deserialize<MyStok>(sc.Substring(1, sc.Length-2));
您也可以反序列化数组到 MyStok
对象的列表,并采取在目标指数为零。
You could also deserialize the array into a list of MyStok
objects, and take the object at index zero.
var myobjList = JSON.Deserialize<List<MyStok>>(sc);
var myObj = myobjList[0];