dglux5_wiki:dataflow:dataflow_blocks_reference:string_operations:subst_block

You are not allowed to perform this action

Substring

Block Group: String Operations
Icon:Substring block icon

The Substring block returns a specific substring from a string.

The block checks for parameters in the following order of importance:

  • A start character position and length
  • A start character position and end character position
  • An end character position and length

For information on using dataflow blocks, see Dataflow.


The following properties of the Substring block can take input and give output.

  • input (string)
  • start (number)
  • length (number)
  • end (number)

input specifies the text string that contains the characters to extract.

start determines the position of the first character to extract. A value of 0 indicates the first character in the input. A negative value counts from the end of the input; for example, -3 indicates the third character from the end.

length specifies the number of characters to extract.

end determines the position after the last character to extract. The character at the end position is not included. A negative value counts from the end of the input.


The following property of the Substring block can give output but cannot take input.

  • output (string)

output returns the substring.


The following are special cases for the Substring block:

  • If start, length, and end are null, the full input string is returned.
  • If only length is set, the first length characters are returned.
  • If only end and length are set, the substring of length characters that ends at end is returned.
  • If end is 0 and start or length is greater than 0, end is treated as the end of the input.
  • If start or end is outside the input, or if start plus length exceeds the length of input, output returns null.
  • If input is null, output returns null.

The following image demonstrates two examples of the Substring block. The leftmost Substring block returns a four-character substring that begins with the character at position 0. The rightmost Substring block returns a substring that begins with the character at position 4 and ends with the character at position 9.

Substring block examplesl


  • dglux5_wiki/dataflow/dataflow_blocks_reference/string_operations/subst_block.txt
  • Last modified: 2026/10/22 13:24
  • by 127.0.0.1