我已将 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/