ENTMF 

The USUBSTR Function

The USUBSTR function returns a substring of the data in a character data item argument that contains UTF-8 or UTF-16 data. The type of this function depends on the argument as follows:
Argument Type Function Type
Alphabetic Alphanumeric
Alphanumeric Alphanumeric
National National
UTF-8 UTF-8

General Format

Syntax for General Format for the USUBSTR function

Arguments

argument-1
Must be alphabetic, alphanumeric, national, or UTF-8. argument-1 must contain valid UTF-8 or UTF-16 data based on its class:
  • If argument-1 is of class alphabetic, alphanumeric, or UTF-8, it must contain valid UTF-8 data.
  • If argument-1 is of class national, it must contain valid UTF-16 data.
argument-2
Must be an integer that is greater than zero. It represents the starting position of a substring in argument-1.
argument-3
Must be an integer that is greater than or equal to zero. It represents the length of a substring in argument-1.
Note: The sum of argument-2 and argument-3 minus one must be less than or equal to ULENGTH(argument-1).

If argument-2 = 3 and argument-3 = 2, the returned value is an alphanumeric character string that contains two UTF-8 or UTF-16 characters in argument-1, starting with the third character.

Return Value

The returned value is an string that is a substring (and same type) of argument-1.

Comments

This function supports ideographic variation selectors (IVS), allowing the font software to select a different glyph from the default. (If no variation exists or supported then the font software will ignore it.) An IVS consists of Unicode characters in the range U-E0100 – U-E01EF. UTF-16 strings use surrogate pairs in the range U-DB40 + DD00 - U-DB40 + DDEF, and UTF-8 strings use the range 0xF3A08480 - 0xF3A087AF.

A Unicode character followed by an IVS is treated as one character when this function is processed.