The RIGHT function outputs the last n characters of the string from the right.
The number of characters returned is specified by the Count property. If the Count property is greater than the number of characters in the string, the entire string is returned.
| Input | Data Type | Description |
|---|---|---|
| Input1 | String | The original string. |
| Input2 | Integer | Sets the Count property. (optional) |
| Output | Data Type | Description |
|---|---|---|
| Output1 | String | The sub-string. |
| Name | Property Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
| Count | int | The number of characters from the right of the string to return. Return empty string, if Count is set to 0. Return whole string, if Count is bigger than the input string's length. |
||||||
| Mode | choice |
Specifies how to count the length.
|
||||||
| Encoding | choice | Specifies encoding when counting by bytes. |
Count property will result in a error.
When "Mode" property is set to Byte, the number of characters is calculated by byte of specified character encoding.
Represents the string "あいうえお" as a Shift JIS and UTF-8,
shift_jis: 82 A0 82 A2 82 A4 82 A6 82 A8
utf-8: E3 81 82 E3 81 84 E3 81 86 E3 81 88 E3 81 8A
For example, you specify "6" as a number of byte in Left function, outputs "あいう" when encoding is shift_jis. Outputs "あい" when encoding is utf-8.
If you specify "5", the output is truncated in both encodings. In this case, the string is truncated so that it can be less than specified number. Thus, "あい" (2 letters, 4 bytes) when encoding is shift_jis. "あ"(1 letter, 3 bytes) when encoding is utf-8
(Mid function, start position is shifted below when it is splitted in the letter.)
Note: The expected result is not aquired when the character encoding with ShiftIn/ShiftOut like iso-2022-jp.
Note: The expected result may be not auired when platform is AIX.
| Property | Output | |||
| Input 1 | Infoteria XML Solution Components | Count | 23 | XML Solution Components |
| Property | Output | |||
| Input1 | 日本語サンプル | Count | 4 | サンプル |