Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved


Chapter 3 Tools : PEEL

PEEL
Returns the result of removing the specified leading and trailing characters from the specified string. (F)
Invocation
peeled_string = PEEL(peelchars, string)
 
On return, contains the peeled string. Its syntax can be C (fixed-length character string), V (variable-length character string), or W (double-byte character).
Usage Notes
PEEL examines both the front and the back of string, and peels each character that matches one of the characters in peelchars. The peeling continues until a non-peel character is encountered.
Example
The following rule peels characters from a string and prints both the original string and the peeled string to the message log:

 
PEEL_1;
_ LOCAL SOURCE_STRING, PEELED_STRING;
_ ------------------------------------------------------------------------
_ ------------------------------------------------------------+-----------
_ SOURCE_STRING = '1231234561323213'; | 1
_ PEELED_STRING = PEEL('321', SOURCE_STRING); | 2
_ CALL MSGLOG('THE PEELED STRING IS: ' || PEELED_STRING); | 3
_ CALL MSGLOG('THE SOURCE STRING IS STILL: ' || | 4
_ SOURCE_STRING); |
     _ ------------------------------------------------------------+-----------

 
Output for the PEEL_1 Rule
Pressing PF2 after executing this rule displays the following on the screen:

 
---------------------------- INFORMATION LOG ----------------------
COMMAND ===> SCROLL ===> P
THE PEELED STRING IS: 456
THE SOURCE STRING IS STILL: 1231234561323213 

 

Copyright © Cloud Software Group, Inc. All Rights Reserved
Copyright © Cloud Software Group, Inc. All Rights Reserved