c# - 如何删除从 python 脚本中接收的服务总线队列接收到的@strin3http//schemas.microsoft.com/2003/10/Serialization/�?

标签 c# python json azure serialization

我已将 Azure 流分析作业的输出设置为服务总线队列,该队列以 JSON 序列化格式发送数据。当我收到 python 脚本中的队列消息以及大括号中的数据时,我会在前面附加 @strin3http//schemas.microsoft.com/2003/10/Serialization/�。我无法修剪它,因为收到的消息没有被识别为字符串或消息。因此,我无法反序列化数据。

最佳答案

This TechNet article建议使用以下代码:

// Get indices of actual message
var start = jsonString.IndexOf("{");
var end = jsonString.LastIndexOf("}") + 1;
var length = end - start;

// Get actual message
string cleandJsonString = jsonString.Substring(start, length);

相当原始,但无论我想什么有用......

关于c# - 如何删除从 python 脚本中接收的服务总线队列接收到的@strin3http//schemas.microsoft.com/2003/10/Serialization/�?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36307767/

相关文章:

python - python 中紧凑但漂亮的 JSON 输出?

python - Django:没有名为 context_processors 的模块,基本 URL

json - 使用Spring Boot从Elasticsearch中查询不可预测的JSON对象

json - AlamofireObjectMapper,嵌套的 JSON 结构在序列化时始终为 nil

Json 解析 Swift 3 Alamofire

c# - 进程峰值内存使用的类型

c# - 尝试使用 Npgsql 更新 C# 上的列

c# - 为什么不能同时使用 2 个 NetworkManager?

c# - 使用 ImmutableList(仅 Release模式)在 UWP 上使用 JSON.NET 反序列化问题

python - 获取图像模式 PIL Python