以下問題/答案似乎回答了如何將 Google 表格陣列過濾到名稱中具有特定術語的人的問題:
- 結果
uj5u.com熱心網友回復:
Sheets that do not include a string
function myFunction(s = "ee") {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const allSheets = ss.getSheets().filter(sh => !~sh.getName().indexOf(s));
const allSheets_names = allSheets.map(sheet => sheet.getSheetName())
const neededSheets = ["tree"];
const filteredListOfSheetsNames = []
neededSheets.forEach(ns =>
allSheets_names.forEach((as, index) => { if (as.indexOf(ns) > -1) { filteredListOfSheetsNames.push(as) } }))
const filteredListOfSheets = filteredListOfSheetsNames.map(name => ss.getSheetByName(name))
}
包括名稱不包括的作業表ee
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/504969.html