TRUNCATEB
The TRUNCATEB function truncates the specified number of bytes from an input binary stream.
Input/Output
Number of Connections: Min: 1/Max:2
| Input | Data Type | Description |
| Input1 | Binary | The original data. |
| Input2 | Integer | Sets the Length property. (optional) |
| Output | Data Type | Description |
| Output1 | Binary | The truncated data. |
Property
| Name | Property Type | Description |
| StartFrom | choice |
Specifies the direction from which truncation is to be performed.
| Left [true]
| - |
truncate the left portion of the input data
|
| Right [false]
| - |
truncate the right portion of the input data
|
|
| Length | int | Specifies the number of bytes to be truncated. |
Topic
- Setting Length to a value less than one will result in an error.
- If Length is greater than the length of the input data, an empty data is output.
How a Binary function handles byte conversions
The Binary Functions LEFTB, RIGHTB, MIDB, REPLACEB and TRUNCATEB handle input binary data as it is. If binary data cannot be successfully converted back to a string, an empty string is output.
Examples
| Property | Output |
| Input1 | 0x6165696F75 | StartFrom | Left | 0x696F75 |
| | Length | 2 | |