在這邊主要介紹List的分群,如有以下的五筆資料
1 | ["00001","00002","00003","00004","00005"] |
這時想要以2來群分,變成下方結果
1 | [["00001","00002"],["00003","00004"],["00005"]] |
程式碼:
1 | using System; |
output:
1 | 0 , count: 2 |
在這邊主要介紹List的分群,如有以下的五筆資料
1 | ["00001","00002","00003","00004","00005"] |
這時想要以2來群分,變成下方結果
1 | [["00001","00002"],["00003","00004"],["00005"]] |
程式碼:
1 | using System; |
output:
1 | 0 , count: 2 |