Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Tools : TAILSTRING

TAILSTRING
Returns the tail portion of the string. (F)
Invocation
tail = TAILSTRING(string, length)
 
On return, contains the source string with the specified number of leading characters removed. Its syntax is the same as string except that, if string is C (fixed-length character string), tail becomes V (variable-length character string).
The string to remove characters from. Its syntax can be C, UN (Unicode), V, or W (double-byte character).
An integer specifying the number of characters to remove from the front of the string. Its syntax is B (binary) with length 4.
Usage Notes
If length is larger than the length of string, an empty string is returned.
If length is negative, an empty string is returned.
Example
This rule extracts a tail string from a string and prints both strings to the message log:

 
TAILSTRING_1;
_ LOCAL SOURCE_STRING, TAIL_STRING;
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ SOURCE_STRING = 'THIS IS A STRING'; | 1
_ TAIL_STRING = TAILSTRING(SOURCE_STRING, 12); | 2
_ CALL MSGLOG('THE TAIL STRING IS: ' || TAIL_STRING); | 3
_ CALL MSGLOG('THE SOURCE STRING IS STILL: ' || | 4
_ SOURCE_STRING); |
_ ------------------------------------------------------------------------

 
Resulting Output
Pressing PF2 after executing this rule displays the following:

 
--------------------- INFORMATIONAL MESSAGE LOG ----------------------
COMMAND ===> SCROLL ===> P
THE TAIL STRING IS: RING
THE SOURCE STRING IS STILL: THIS IS A STRING

 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved