STRING_SEG macro
The STRING_SEG
macro
is available only in Unica Campaign.
Syntax
STRING_SEG(from, to, data)
Parameters
from
The
number of characters offset from the beginning of the string to start
extracting the string segment from. This must be a positive integer
greater than zero and less than to
, or STRING_SEG
returns an empty string.
to
The number
of characters offset from the beginning of the string to stop extracting
the string segment from. This must be a positive integer greater than
or equal to from
. If to
equals from
(and to
is
less than or equal to the length of the string), one character is
returned.
data
ASCII text string values.
This can be ASCII text in quotes, a column of text, a cell range containing
text, or an expression evaluating to any of the above. For the format
definition of data
, see the "Macro Function
Parameters" section in the chapter in this guide for your product.
Description
STRING_SEG
returns the string segment between two indexes from each string value
in the specified data range. If from
is greater
than the length of a string, nothing is returned. If to
is greater than the length of a string, all characters from from
are returned.
Examples
TEMP = STRING_SEG(1, 6, "JAN 15, 1997")
Creates a new column named |
TEMP = STRING_SEG(5, 20, "Pressure")
Creates a new column named |
TEMP = STRING_SEG(5, 6, V1)
Creates a new column named |
TEMP = STRING_SEG(10, 20, V1:V3)
Creates three new columns named |
TEMP = STRING_SEG(5, 10, V4[1:50]:V6]
Creates three new columns named |
Related functions
Function | Description |
---|---|
STRING_CONCAT |
Concatenates two text strings from the specified data ranges |
STRING_HEAD |
Returns the first n characters of each string in the specified data range |
STRING_LENGTH |
Returns the length of each string in the specified data range |
STRING_TAIL |
Returns the last n characters of each string in the specified data range |