SubString

The Substring component retrieves a substring from a string. The start character position and length of the substring is specified.

Screenshot

Ports

The Substring component exposes the Control In, Control Out, Data In, and Data Out ports by default.

Port Description
ControlIn Must be connected to the Control Out port of one or more components.
ControlOut Must be connected to the Control In port of any other component.
Data In The Substring component exposes the following Data In ports by default:

Text: specifies the string from which the substring is to be retrieved (String).
startIndex: specifies the start character position of the substring (int32).
Length: specifies the length end character position of the substring (int32).
Data Out Returns the specified substring.

Properties

To edit the properties of the Substring component, in the Properties window, change the required property. You can edit the following properties.

Property Description
Search Search for the respective property.
Delay After Execution Specifies the wait time (in seconds) after the action is executed.
Delay Before Execution Specifies the wait time (in seconds) before the action is executed.

Example

Let us consider an example.

Screenshot

To retrieve a substring from a string:

  1. In the Toolbox, expand Utilities and then expand String Utilities.

  2. Drag the SubString component and drop it on the Design surface.

  3. Double-click the Text box and enter the required string.(ex: Welcome to Intellibot Company.)

  4. Double-click the startIndex box and enter the start character position of the substring.The string Index starts from “0”.

  5. Double-click the length box and enter the length of the string that is required to be extracted from the position of the substring start index.

    In this Example the Substring is being retrieved form the 11th character of the entire String and the length of the String needs to be extracted from the 11th character is “10” as Intellibot has 10 alphabets.

    Note

    You can override the existing data source for the Text and startIndex and Length Data In ports.

    To override the existing data source:

    • Right-click the required Data In port.

    • Click Override and change the data source.

    To learn more about overriding the data source of the data port, refer the Override section.

  6. Drag the Show component and drop it on the Design surface.

  7. Connect the control ports and data ports in the activity.

  8. In the toolbar, click Run.
    The specified substring is retrieved from the string.

    Screenshot