UnicodeSubstring (Unicode function)
Return a substring of the method object string (Unicode class)
UnicodeSubstring returns a specific number of characters, starting at a specific position, from the method object Unicode string, possibly padding it on the right.
%outUnicode = unicode:UnicodeSubstring( position, [length], [Pad= c])
|%outUnicode||A Unicode variable to receive the result of the UnicodeSubstring method.|
|unicode||A Unicode string.|
|position||The character position in the method object that is the starting point of the substring that is returned. The first character from the left in the method object is position |
|length||The number of characters to return. If the method object has fewer characters than the requested number of characters (starting at the position), it is either padded to the requested length, or the entire method object starting at the position is returned with no padding, depending on the value of the Pad parameter.|
|Pad||The character used to pad the result string on the right if it is shorter than the requested length. Pad defaults to the null string (''), which means no padding is done. Pad is a name required parameter.|
- The length must be a non-negative number. A negative length results in request cancellation.
- The Pad parameter must be either null or a single character. A longer value results in a compilation error.
- If the starting position is known to be 1, it might be tidier and slightly more efficient to use the UnicodeLeft method instead of UnicodeSubstring.
- UnicodeSubstring is available as of Sirius Mods Version 7.5.
- The following statement places into
%ythe 5 characters of
%xstarting at the third character. If
%xis shorter than 7 characters, then all of
%xis copied into
%y = %x:unicodeSubstring(3, 5)
- The following statement displays
The question mark in the result represents a valid EBCDIC character that is not displayable.