我正在为Google表格编写Google Apps脚本,我想从一系列列中进行选择,但要排除中间的几列。
我有一张类似的床单
+-------+-----+--------+--------+-------+
| Name | Age | Height | Income | State |
+-------+-----+--------+--------+-------+
| Bob | 23 | 185 | 50000 | OH |
| Jim | 35 | 160 | 23000 | HI |
| Frank | 24 | 142 | 44565 | CA |
| Tom | 24 | 155 | 23758 | NY |
+-------+-----+--------+--------+-------+
我想这样选择前两列和最后一列
+-------+-----+-------+
| Name | Age | State |
+-------+-----+-------+
| Bob | 23 | OH |
| Jim | 35 | HI |
| Frank | 24 | CA |
| Tom | 24 | NY |
+-------+-----+-------+
sheet.getRange()
可以很好地获得连续范围,但是将两个具有相同行数的范围组合在一起的最紧凑方法是什么?