String Node
  • 17 Jul 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

String Node

  • Dark
    Light
  • PDF

Article summary

The node supports commonly used string operations. There is a growing list of operations that can be used to fulfill various requirements. The selection operation reveals a dynamic set of inputs.

Before performing any operations, you must add the String Node to the graph and select it. Upon selection, an operations dropdown will appear at the right-bottom corner of the page.

Currently, the String Node provides three primary operations: Convert to String, Join, and Trim.

Choose a required operation from the dropdown menu. Selecting an operation will reveal options corresponding to that operation.

Success

In the future, additional operations will be available


Convert to String

The Convert to String operation converts all input data to a string. This is useful when the input type is uncertain, such as JSON or numbers.

Input: Input

Additional Input: input data type

Output: Single String

Example: Convert to string operation

  • Insert a set node and set the value of input 1 to "56".

  • For Convert to String operation, define Input Value to Input 1 and Output to output 2.

  • For Trim operation, define Input Value to Output 2 and Output to output 1.

  • The output will display the input value successfully converted to a string.


Join

The Join operation concatenates multiple input strings. You can also specify a separator to be used between the strings. The Input 1 and Input 2 fields are mandatory to provide the output. For instance, it can be used to join first name and last name for personalized notifications.

Ensure all the inputs are strings while using join operation, or convert non-string elements to strings first using the Convert to String operation.

idea

Users can join multiple words by chaining multiple nodes with join operations in the String Node.

Input: Two or more inputs

Additional Input: Separator (Dynamic input)

Output: Single String

Example: Join operation.

  • Insert a first set node and set the value of input 1 to "Xponent".

  • Insert a second node and set the value of input 2 to "library".

  • For first join operation, define below values:

    • Input Value 1: Define input 1 value “Xponent”

    • Input Value 2: Define literal value (hyphen)

    • Input Value 3: Define input 2 value “library”

    • Separator: Define literal value (Widespace)

    • Output: Define output 1

  • Insert a third node and set the value of input 3 to "testing completed.".

  • For second join operation, define below values:

    • Input Value 1: Define output 1 value “Xponent - library”

    • Input Value 2: Define input 3 value (testing completed.)

    • Input Value 3: optional

    • Separator: Define literal value (Widespace)

    • Output: Define output 2

  • The output you would receive as "Xponent - library testing completed.".


Trim

The Trim operation removes whitespace from both ends of a string and returns a new string. It does not modify the original string. If the provided input is not a string, an error will be thrown.

Input: Single String

Additional Input: N/A

Output: Single String

The trim operation reacts differently in two scenarios with the provided string and non-string values, as mentioned below.

Example: Using Input - String and Non-string value

Scenario 1: Input value is String value

  • Insert a set node and set the value of input 1 to " Xponent ".

  • For trim operation, define Input Value to Input 1 and Output to output 1.

  • Output will be an "Xponent"


Scenario 2: Input value is Non-string value

  • For trim operation, define Input Value to Input 1 and Output to output 1.

  • Output will display an error: Input value(s) does not contain string data



Is it helpful? React and share your comment

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence