Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

StrSearch

  • Last UpdatedJul 18, 2023
  • 1 minute read

Searhes for a string within a string, commencing at a specified offset. The result of the search is the index in the source string, where the first character of the sub-string is found. Index 0 is the first character in the string, index 1 is the second, and so on.

Syntax

StrSearch(Offset, String, Substring)

Offset:

The offset in the string, commencing at 0.

String:

The source string.

Substring:

The substring to search for.

Return Value

The index in the search string, or -1 if the sub-string does not exist in the string.

StrLength

Example

Variable=StrSearch(1,"ABCDEF","CD");

! Sets Variable to 2.

Variable=StrSearch(4,"ABCDEF","CD");

! Sets Variable to -1.

Variable=StrSearch(5,"ABCDEF","F");

! Sets Variable to 5.

See Also

String Functions

Using the Caret Escape Sequence Character

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in