ComfyUI > Nodes > ComfyUI-JDCN > JDCN_SplitString

ComfyUI Node: JDCN_SplitString

Class Name

JDCN_SplitString

Category
🔵 JDCN 🔵
Author
daxcay (Account age: 93days)
Extension
ComfyUI-JDCN
Latest Updated
2024-06-13
Github Stars
0.06K

How to Install ComfyUI-JDCN

Install this extension via the ComfyUI Manager by searching for ComfyUI-JDCN
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI-JDCN in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • High-speed GPU machines
  • 200+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 50+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

JDCN_SplitString Description

Split a string into two parts based on a specified substring for text manipulation in AI art projects.

JDCN_SplitString:

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.

JDCN_SplitString Input Parameters:

MainString

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.

SearchFor

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.

StartFrom

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.

Occurence

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.

IncludeSearchFor

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.

JDCN_SplitString Output Parameters:

Suffix

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.

Prefix

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.

FoundAt

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.

JDCN_SplitString Usage Tips:

  • To split a string at the first occurrence of a substring, set Occurence to 1 and StartFrom to front.
  • If you need to split a string from the end, set StartFrom to rear and adjust the Occurence parameter as needed.
  • Use the IncludeSearchFor parameter to control whether the substring should be part of the Prefix or not, depending on your specific needs.

JDCN_SplitString Common Errors and Solutions:

Empty MainString

  • Explanation: The MainString parameter is empty.
  • Solution: Ensure that you provide a non-empty string for the MainString parameter.

Empty SearchFor

  • Explanation: The SearchFor parameter is empty.
  • Solution: Provide a valid substring for the SearchFor parameter to enable the node to perform the split operation.

Substring Not Found

  • Explanation: The specified SearchFor substring is not found in the MainString.
  • Solution: Verify that the SearchFor substring exists within the MainString and adjust the Occurence and StartFrom parameters if necessary.

JDCN_SplitString Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI-JDCN
RunComfy

© Copyright 2024 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals.