ComfyUI Node
Clean String Adv. π²
Cleans up and formats the given text with a set of optional filters: - Strip whitespace (off/left/right/both) from the input string - Remove or add trailing comma from the input string - Collapse multiple spaces in the input string - Convert to lowercase/uppercase and more - Control newline handling (off/remove empty/collapse lines) Useful for normalizing input strings for consistent processing.
Clean String Adv. π²
- text
βinput_textβΊ
βstripbothβΊ
βtrailing_commasremoveβΊ
βnewlinesoffβΊ
βcollapsespaces + commasβΊ
βremove_duplicate_tagsfalseβΊ
βcaseoffβΊ
CategoryRyuuNoodles π²/Text
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| input_text | STRING | Text input to be cleaned. | |
| strip | COMBO | both | Control which side(s) of whitespace to strip from the input string. |
| trailing_commas | COMBO | remove | Remove or add a comma at the end of the input string. Will not add a comma if one already exists, but will add a space if 'add + space' is chosen and a comma exists but no space. |
| newlines | COMBO | off | Control how newlines are handled off = keep all lines remove empty = drop blank lines collapse lines = join all lines into one |
| collapse | COMBO | spaces + commas | Collapse multiple consecutive spaces into one, or collapse both spaces and commas into a single occurrence depending on the selected option. Example: 'apple, banana, apple, orange.' β 'apple, banana, orange.' |
| remove_duplicate_tags | BOOLEAN | false | Remove duplicate tags/words separated by commas, handling spaces around commas and ensuring only unique entries remain. Example: 'apple, banana, apple, orange' β 'apple, banana, orange' |
| case | COMBO | off | Change the case of the string. Examples with input 'apple, banana, orange.': off = no change ('apple, banana, orange. juice') lowercase = all lowercase ('apple, banana, orange. juice') uppercase = ALL UPPERCASE ('APPLE, BANANA, ORANGE. JUICE') capitalize = Capitalize the start of every sentence (after punctuation or empty lines) and lowercase the rest ('Apple, banana. Orange. Juice') capitalize_1st_letter = Capitalize only the first letter of the input string ('Apple, banana. orange. juice') camelcase = likeThisExample ('appleBananaOrange.Juice') pascalcase = LikeThisExample ('AppleBananaOrange.Juice') snakecase = like_this_example, always lowercase ('apple_banana_orange._juice') kebabcase = like-this-example, always lowercase ('apple-banana-orange.-juice') titlecase = Every Word Capitalized ('Apple, Banana, Orange. Juice') |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| text | STRING | β |