STRING_HEAD macro
The STRING_HEAD macro
is available only in HCL®
Campaign.
Syntax
STRING_HEAD(num_chars, data) Parameters
num_chars
The
number of characters to returns from the beginning of each string
in data. This must be a positive integer greater
than zero.
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 HCL
product.
Description
STRING_HEAD
returns the first num_chars characters from each
string value in the specified data range. If num_chars
is greater than the number of characters in a text string, the remaining
characters are padded with the null character " \0 ".
Examples
TEMP = STRING_HEAD(3, "JAN 15, 1997")
Creates a new column named |
TEMP = STRING_HEAD(10, "Pressure")
Creates a new column named |
TEMP = STRING_HEAD(5, V1)
Creates a new column named |
TEMP = STRING_HEAD(1, V1:V3)
Creates three new columns named |
TEMP = STRING_HEAD(12, 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_LENGTH |
Returns the length of each string in the specified data range |
STRING_SEG |
Returns the string segment between two specified indexes |
STRING_TAIL |
Returns the last n characters of each string in the specified data range |