//处理JSON数据格式
  public string json(string json)
  {
   string []index1=Getindex(json,"\'").Split(',');
   string []index2=Getindex(json,"\\“).split(',');
   for(int i=0;i<index1.Length-1;i++)
   {
    json.Insert(int.Parse(index1[i]), "\\");
   }
   for(int j=0;j<index2.Length-1;j++)
   {
    json.Insert(int.Parse(index2[j]), "\\");
   } 
   return json.Replace("\r", "\\r").Replace("\n", "\\r");
  }

  public string Getindex(string a,string b)
  {
   string cccc="";
   int i=0;
   int index=a.IndexOf(b);
   while(index>=0)
   {
    cccc+=index+",";
    i++;
    index=a.IndexOf(b,index+1,a.Length-1-index);
   }
   return cccc;
  }

相关文章:

  • 2022-12-23
  • 2021-11-01
  • 2021-08-05
  • 2021-09-17
  • 2021-09-24
  • 2021-09-06
猜你喜欢
  • 2022-12-23
  • 2022-01-24
  • 2022-12-23
  • 2021-12-02
  • 2021-07-26
相关资源
相似解决方案