PropertySubstringValve
Note
Create a substring of a string property.
Index is zero based, where index 0 represents the first character in the string.
Begin index is inclusive, end index is exclusive.
Valve operates on the Current Item Set and will process all items surviving the common item filtering rules.
Properties
| Name | Description | Default value | Mandatory | Supports property expansion |
|---|---|---|---|---|
| source | The name of the source property. | Yes | Yes | |
| dest | The destination property. If not specified the resulting value will be put in source (i.e source will be replaced). | No | Yes | |
| begin_index | The beginning index, inclusive. | Yes | No | |
| end_index | The ending index, exclusive. If not specified the substring extends to the end of the source string. | No | No |
Example
The example text is the word "BANANA", and in the table below, the individual characters, their corresponding indexes in the string, are clarified:
| 0 | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| B | A | N | A | N | A |
Using the example text from above, some example are outline below where begin_index and end_index have been set to certain values, and what the actual result would then be:
| begin_index | end_index | result |
|---|---|---|
| 0 | "BANANA" | |
| 1 | "ANANA" | |
| 5 | "A" | |
| 0 | 5 | "BANAN" |
| 0 | 3 | "BAN" |
| 3 | 6 | "ANA" |
Example Configuration
{
"name": "PropertySubstringValve",
"config": {
"source":"{{request.word}}",
"end_index":"7",
"begin_index":"2"
}
}
Requirements
Item set must have at least one entry.