REPLACEB
The REPLACEB function replaces the specified section of bytes from the input data with the specified replacement data.
Input/Output
Number of Connections: Min: 2/Max:4
| Input | Data Type | Description |
| Input1 | Binary | The original data. |
| Input2 | Binary | The replacement data. |
| Input3 | Integer | Sets the Offset property. (optional) |
| Input4 | Integer | Sets the Count property. (optional) |
| Output | Data Type | Description |
| Output1 | Binary | The new, modified data. |
Property
| Name | Property Type | Description |
| Offset | int | The offset, in bytes, from the start of the input data from which byte data is selected. The first byte in the input data is "1". |
| Count | int | The number of bytes to select. |
Topic
- A value less than 1 entered in the Offset property will result in an error. The mapper component that this function is in will abort and throw an exception.
- If the Offset is greater than the number of bytes in Input1, the Input2 byte data is concatenated to the end of Input1.
- If the Offset plus Count is greater than the number of bytes in Input1, the byte data after the Offset is removed from Input1 and the Input2 byte data is concatenated to the end.
- If the length of Input2 is zero bytes, Count bytes from Input1, starting at the Offset will be removed and the new modified data will be 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.
Example
| Property | Output |
| Input1 | 0x616569 | Offset | 3 | 0x61656F75 |
| Input2 | 0x6F75 | Count | 2 | |