小编Ann*_*nna的帖子

在C#中访问字符串的一部分

我从下面的代码行中收到以下令牌值。

mytoken = await response.Content.ReadAsStringAsync();
Run Code Online (Sandbox Code Playgroud)
// The contents of mytoken is as the following.
// This is what the debug window shows me
mytoken = "{\"token\":\"R6ZdGByrEguKvYGyfHZRgMzabdynQgPY.\",\"validity\":true}"
Run Code Online (Sandbox Code Playgroud)

我试图通过使用访问mytoken的内容,但这mytoken["token"]似乎不起作用。我在这里想念什么吗?我需要先反序列化字符串吗?

我想在另一个这样的变量中得到最终结果。

result = "R6ZdGByrEguKvYGyfHZRgMzabdynQgPY."
Run Code Online (Sandbox Code Playgroud)

任何帮助表示赞赏。

c# xamarin xamarin.forms

0
推荐指数
1
解决办法
69
查看次数

标签 统计

c# ×1

xamarin ×1

xamarin.forms ×1