📜  谷歌应用脚本列到数组 indexOf - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:10.951000             🧑  作者: Mango

代码示例1
//  Google app script column to array indexOf
var numRows = sheet.getLastRow();
var nameRng = sheet.getRange(2, 3, numRows).getValues(); // this is [[v1],[v2],...
var nameArr = String(nameRng).split(",");   // force column range into a String() and then split() it back into an array
if (nameArr.indexOf(inName) > 0 )