STR_STARTS_WITH

Use the STR_STARTS_WITH script function to check whether a string begins with a specified substring. The function also returns Y when String1 and String2 are identical. The comparison is case sensitive.

Syntax

STR_STARTS_WITH (String1, String2)

Parameters

Parameter Description Format
String1 The string to check Script literal or script variable
String2 The substring to check for at the beginning of String1 Script literal or script variable

Return Codes

Return Value Condition
Y String1 starts with String2
N String1 does not start with String2

Examples

The following example retrieves the object title and checks whether it starts with "Docu". If so, a message is written to the activation report.

:SET &VAR# = GET_ATT(OBJECT_TITLE)

:SET &CHECK# = STR_STARTS_WITH(&VAR#, "Docu")

:IF &CHECK# EQ "Y"

: P "Object title starts with 'Docu'"

:ENDIF

See also: