Automation Engine Script Guide > Ordered by Function > Strings > STR_STARTS_WITH

STR_STARTS_WITH

Script Function: Checks whether a string starts with a certain other string.

Syntax

STR_STARTS_WITH(String1, String2)

Syntax

Description/Format

String1

The string that should be checked.
Format: script literal or script variable 

String2 The string that is used for checking string1.
Format: scriptA particular Automation Engine object type. literal or script variableA placeholder for a value within a script.

Return Codes

"Y" = String1 starts with string2
"N" = String1 does not start with string2.

Comments

This script element checks whether the beginning of a certain string complies with another string. Note that you must specify the string that should be checked (parameter String1) and the string that should be used for checking the required beginning (String2).

This script functionPre-defined run book template in the Automation Engine. One single step only, e.g. Start Windows Service, Copy file,… will also supply "Y" when String1 and String2 are identical.

Note that this comparison is case sensitive.

Examples

The following example reads the objectAutomation Engine controlled activities and processes are structured in the form of objects. See also: Task title and checks whether it starts with the term "Docu". If so, a corresponding message is written to the activation reportA report provides more detailed information about a task's execution or a component..
 
:SET &VAR#GET_ATT(OBJECT_TITLE)
:SET &CHECK# = STR_STARTS_WITH(&VAR#,"Docu")
:IF &CHECK# EQ "Y"
P "Objekttitel beginnt mit 'Docu'"
:ENDIF

 

See also:

Script Elements Description

STR_ENDS_WITH

Checks whether a string ends with a certain other string.

 


Automic Documentation - Tutorials - Automic Blog - Resources - Training & Services - Automic YouTube Channel - Download Center - Support

Copyright © 2016 Automic Software GmbH