base » substringBefore(text,delim,saveVar)
Description
This command save the portion of text that is before delim to a variable denoted as saveVar.
Note that:
delimmust be specified. To denote space, use either thespacecharacter or(blank).- If
delimis not found, thensaveVaris set totext. IOW, the entire content oftextis saved under the variable namedsaveVar. - Only the first occurrence of
delimis considered.
Parameters
- text - the text where the substring operation is to be performed. Variable expansion is supported via the
${...}syntax. - delim - the delimiter to use fore extract from
text. Only first occurrence is considered. - saveVar - the variable to use for saving the result of the substring operation. If
delimis not found intext, thensaveVarwill be saved astext.
Example
Script:

… and the output as follows:
