Visit ComfyUI Online for ready-to-use ComfyUI environment
Determines substring presence in larger strings, aiding text analysis, data validation, and content filtering with case sensitivity support.
The StringContains
node is designed to help you determine whether a specific substring exists within a larger string. This node is particularly useful when you need to verify the presence of certain text patterns or keywords within a given string, which can be essential for tasks such as text analysis, data validation, or content filtering. By providing a straightforward method to check for substrings, the StringContains
node simplifies the process of string analysis, allowing you to focus on the creative aspects of your work without getting bogged down by complex string manipulation logic. Its ability to handle case sensitivity further enhances its utility, making it adaptable to various scenarios where precise text matching is required.
The string
parameter represents the main text in which you want to search for a specific substring. This is the larger body of text that will be examined to determine if it contains the specified substring. The parameter accepts multiline strings, allowing for comprehensive text analysis across multiple lines.
The substring
parameter is the specific sequence of characters you are looking to find within the main string. This parameter also supports multiline input, enabling you to search for complex text patterns that span multiple lines.
The case_sensitive
parameter is a boolean option that determines whether the search should consider case differences between the main string and the substring. If set to True
, the search will be case-sensitive, meaning that the exact case of the characters must match. If set to False
, the search will ignore case differences, allowing for a more flexible matching process. The default value is True
.
The contains
output parameter is a boolean value that indicates whether the specified substring was found within the main string. A value of True
means the substring is present, while False
indicates it is not. This output provides a clear and concise result of the substring search, allowing you to make informed decisions based on the presence or absence of the desired text.
case_sensitive
parameter to True
if the exact case is important, such as when dealing with case-sensitive identifiers or proper nouns.case_sensitive
parameter set to False
when you want to perform a more general search that ignores case differences, which can be useful for finding text patterns regardless of capitalization.string
or substring
string
or substring
parameters is not of the expected string type.string
and substring
inputs are valid strings. If you are using variables, verify that they contain string data before passing them to the node.contains
output is False
, indicating that the substring was not found in the main string.substring
value to ensure it is correctly specified. Consider adjusting the case_sensitive
parameter if case differences might be affecting the search results.RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Playground, enabling artists to harness the latest AI tools to create incredible art.