ComfyUI Node: endswith

Class Name

Basic data handling: StringEndswith

Category
Basic/STRING
Author
StableLlama (Account age: 861days)
Extension
Basic data handling
Latest Updated
2026-05-07
Github Stars
0.04K

How to Install Basic data handling

Install this extension via the ComfyUI Manager by searching for Basic data handling
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter Basic data handling 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
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

endswith Description

Determines if a string ends with a specified suffix, with optional start and end positions.

endswith:

The StringEndswith node is designed to determine if a given string concludes with a specified suffix. This functionality is particularly useful when you need to verify the ending of strings, such as file extensions or specific text patterns. The node provides flexibility by allowing you to specify optional start and end positions within the string, enabling you to focus on a particular substring segment. This feature is beneficial for tasks that require precise string validation, ensuring that the string ends with the desired suffix, thereby enhancing the accuracy and reliability of your string handling operations.

endswith Input Parameters:

string

The string parameter represents the main text input that you want to evaluate. It is the string whose ending you wish to check against the specified suffix. The default value is an empty string, and it accepts any string value. This parameter is crucial as it forms the basis of the operation, determining the context in which the suffix check is performed.

suffix

The suffix parameter is the substring you want to verify as the ending of the main string. It also defaults to an empty string and accepts any string value. This parameter is essential because it defines the specific ending pattern you are looking for in the main string, allowing you to confirm whether the string concludes with this particular sequence.

start

The start parameter is optional and specifies the starting index from which the suffix check should begin within the main string. It defaults to 0, with a minimum value of 0. This parameter allows you to narrow down the portion of the string you want to evaluate, providing more control over the operation by focusing on a specific segment of the string.

end

The end parameter is optional and indicates the ending index up to which the suffix check should be performed. It defaults to 0, which implies checking until the end of the string. This parameter allows you to limit the suffix check to a particular section of the string, enhancing the precision of the operation by defining the exact range for evaluation.

endswith Output Parameters:

boolean

The output is a boolean value that indicates whether the main string ends with the specified suffix. A True value signifies that the string indeed concludes with the given suffix within the defined range, while a False value indicates that it does not. This output is crucial for decision-making processes where the presence or absence of a specific string ending determines subsequent actions or validations.

endswith Usage Tips:

  • Use the start and end parameters to focus the suffix check on a specific part of the string, which can be particularly useful when dealing with substrings or when the string contains multiple sections of interest.
  • Ensure that the suffix parameter accurately reflects the ending pattern you are checking for, as even minor discrepancies in the suffix can lead to incorrect results.

endswith Common Errors and Solutions:

Incorrect suffix match

  • Explanation: The string does not end with the specified suffix, possibly due to a mismatch in case or characters.
  • Solution: Double-check the suffix parameter to ensure it matches the desired ending exactly, including case sensitivity.

Index out of range

  • Explanation: The start or end parameters are set incorrectly, leading to an invalid range for the suffix check.
  • Solution: Verify that the start and end parameters are within the bounds of the string length and adjust them as necessary to define a valid range.

endswith Related Nodes

Go back to the extension to check out more related nodes.
Basic data handling
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

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.

endswith