Visit ComfyUI Online for ready-to-use ComfyUI environment
Divide string into parts based on delimiter and indices for precise text manipulation and data extraction.
The StringSplit node is designed to divide a given string into three distinct parts based on a specified delimiter and range indices. This node is particularly useful for breaking down complex strings into manageable sections, allowing you to focus on specific parts of the text. By specifying start and end indices, you can extract a middle section of the string while also obtaining the text before and after this section. This functionality is beneficial for tasks that require precise text manipulation, such as processing prompts or extracting specific data from a string. The node ensures that the indices are within valid ranges and automatically adjusts them if necessary, providing a robust and user-friendly experience.
The text parameter is the string that you want to split. It serves as the main input for the node, and the entire operation revolves around dividing this string into parts. There are no specific minimum or maximum values for this parameter, as it can be any string of any length.
The start parameter indicates the starting index for the middle section of the string. It determines where the extraction of the middle part begins. The value should be a non-negative integer, and the node will automatically adjust it to ensure it is within the valid range of the string's parts.
The end parameter specifies the ending index for the middle section of the string. It marks the point where the extraction of the middle part ends. Like the start parameter, it should be a non-negative integer, and the node will adjust it to ensure it is within the valid range.
The delimiter parameter is the character or string used to split the main text into parts. It defines how the string is divided, and if not provided, the node defaults to using a comma (,). This parameter is crucial for determining the boundaries of the split sections.
The before output is the portion of the string that appears before the specified middle section. It includes all text from the start of the string up to, but not including, the start index. This output is useful for retaining the initial part of the string that precedes the main area of interest.
The middle output is the extracted section of the string between the start and end indices. It represents the main focus of the split operation and is the part of the string you are most interested in analyzing or manipulating.
The after output is the portion of the string that follows the specified middle section. It includes all text from the end index to the end of the string. This output is useful for retaining the trailing part of the string that comes after the main area of interest.
delimiter parameter to effectively split strings that contain specific separators, such as commas or semicolons, to ensure accurate division of the text.start and end indices to focus on different sections of the string, allowing you to extract and analyze specific parts without altering the original text.start index is greater than the end index, the node will automatically swap them to maintain a valid range.start index is less than or equal to the end index to avoid automatic adjustments and achieve the desired output.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.