Visit ComfyUI Online for ready-to-use ComfyUI environment
Split a string into two parts based on a specified substring for text manipulation in AI art projects.
The JDCN_SplitString
node is designed to help you split a given string into two parts based on a specified substring. This node is particularly useful when you need to isolate specific sections of a string for further processing or analysis. By allowing you to define the starting point of the search (either from the front or rear of the string), the occurrence of the substring to look for, and whether to include the substring in the resulting split, this node provides a flexible and powerful way to manipulate text data. Its primary goal is to simplify the process of string manipulation, making it easier for you to work with complex text structures in your AI art projects.
This parameter represents the main string that you want to split. It is a required input and must be provided for the node to function. The MainString
is the text that will be searched for the specified substring.
This parameter specifies the substring that you want to search for within the MainString
. If this substring is found, the MainString
will be split at this point. If the SearchFor
string is empty, the node will return empty results.
This parameter determines the direction from which the search for the SearchFor
substring will begin. It can be set to either front
or rear
. If set to front
, the search will start from the beginning of the MainString
. If set to rear
, the search will start from the end of the MainString
.
This parameter specifies which occurrence of the SearchFor
substring to look for. It is an integer value with a default of 1, a minimum of 1, and a maximum of 9999. For example, if set to 2, the node will split the MainString
at the second occurrence of the SearchFor
substring.
This boolean parameter determines whether the SearchFor
substring should be included in the resulting split. If set to True
, the SearchFor
substring will be included in the Prefix
part of the split. If set to False
, it will be excluded.
The Suffix
output is the part of the MainString
that comes after the SearchFor
substring. If the SearchFor
substring is not found, the Suffix
will be the entire MainString
.
The Prefix
output is the part of the MainString
that comes before the SearchFor
substring. If the SearchFor
substring is not found, the Prefix
will be an empty string.
The FoundAt
output is an integer that indicates the position at which the SearchFor
substring was found in the MainString
. If the SearchFor
substring is not found, FoundAt
will be -1.
Occurence
to 1 and StartFrom
to front
.StartFrom
to rear
and adjust the Occurence
parameter as needed.IncludeSearchFor
parameter to control whether the substring should be part of the Prefix
or not, depending on your specific needs.MainString
parameter is empty.MainString
parameter.SearchFor
parameter is empty.SearchFor
parameter to enable the node to perform the split operation.SearchFor
substring is not found in the MainString
.SearchFor
substring exists within the MainString
and adjust the Occurence
and StartFrom
parameters if necessary.© Copyright 2024 RunComfy. All Rights Reserved.