Skip to main content

Метод CellRange:find

Метод выполняет поиск ячеек, соответствующих заданному запросу, в текущем диапазоне.

Вызов​


function find(string, settings)

Параметры​

  • string: поисковый запрос, тип string.

  • settings: (необязательный) параметры поиска, тип TableSearchSettings.

Возвращает​

  • список ячеек, соответствующих поисковому запросу.

Пример​


local sheet = document:getBlocks():getTable(0)
local cellRange = sheet:getCellRange("B1:B20")

local searchProps = DocumentAPI.TableSearchSettings()
searchProps.caseSensitive = DocumentAPI.CaseSensitive_No
searchProps.matchBehaviour = DocumentAPI.TableSearchSettings.MatchBehaviour_Glob
searchProps.searchIn = DocumentAPI.TableSearchSettings.SearchProperty_Value
searchProps.wholeWords = true

local results = cellRange:find("*eye", searchProps)
for cell in results do
print(cell:getFormattedValue()) -- Steeleye Stout
end