跳到主要内容

SEARCH

Returns the number of the character at which a specific character or text string is first found, reading left to right (not case-sensitive).

Syntax

expression.SEARCH(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | stringThe text to find. The ? and * wildcard characters can be used. Use ~? and ~* to find the ? and * characters.
arg2RequiredApiRange | ApiName | stringThe text where to search for the specified text.
arg3OptionalApiRange | ApiName | numberThe character number in the search text, counting from the left, at which to start searching. If omitted, 1 is used.

Returns

number

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.SEARCH("line", "Online Office"));