How to combine/merge two JArrays in JSON.NET

前端 未结 4 1084
半阙折子戏
半阙折子戏 2021-01-04 02:38

I can\'t figure out how to concatenate two JArrays that I got be using JArray.Parse? The order of the arrays must be preserved i.e. the first array should be first and eleme

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-04 02:48

    I used the Merge method, which modifies the original JArray:

     JArray test1 = JArray.Parse("[\"john\"]");
     JArray test2 = JArray.Parse("[\"doe\"]");
     test1.Merge(test2);
    

提交回复
热议问题