Visit ComfyUI Online for ready-to-use ComfyUI environment
Divide text into two parts based on a separator for independent processing or analysis.
The TextSplit
node is designed to help you divide a given text into two parts based on a specified separator. This can be particularly useful when you need to process or analyze different sections of a text independently. The node offers flexibility in how the text is split, allowing you to choose whether to split from the start or the end of the text and which half of the split text to return. This functionality can be beneficial for tasks such as text preprocessing, data cleaning, or any scenario where managing text segments separately is required.
This parameter represents the input text that you want to split. It is a string and is required for the node to function. The text will be divided based on the specified separator. The default value is an empty string, and it is mandatory to provide an input for this parameter.
The separator is a string that determines where the text will be split. By default, the separator is set to a period ("."
). You can customize this to any character or string that suits your needs. The choice of separator directly impacts how the text is divided into two parts.
This boolean parameter allows you to choose the direction of the split. If set to True
, the text will be split from the end (rightmost occurrence of the separator). If set to False
, the text will be split from the start (leftmost occurrence of the separator). The default value is False
.
This parameter specifies which half of the split text to return. It offers two options: "First Half"
and "Second Half"
. Depending on your selection, the node will return either the part of the text before the separator or the part after the separator. This allows you to focus on the specific segment of the text that is most relevant to your task.
The output parameter is a string that contains the selected half of the split text. Depending on the return_half
parameter, this will either be the portion of the text before or after the specified separator. This output is essential for further processing or analysis of the text segment.
separator
parameter to ","
and return_half
to either "First Half"
or "Second Half"
depending on which part you need.reverse
parameter to True
and provide the word as the separator
.return_half
parameter to easily extract the beginning or ending part of a text, which can be useful for tasks like extracting the main content or the conclusion of a paragraph.text
parameter is provided as a string. Convert any non-string input to a string before passing it to the node.reverse
parameter is not set correctly.reverse
parameter to control the direction of the split, ensuring it matches the intended use case.© Copyright 2024 RunComfy. All Rights Reserved.