text_remove_duplicate_characters
Remove duplicate characters from text, keeping either the first or last occurrence. Dedupe at the character level with case and whitespace options.
Instructions
Remove Duplicate Characters From Text. Removes repeated characters from text so each character appears once, keeping either the first or the last occurrence. Use this to dedupe at the character level (compress aabbcc to abc); use text_duplicate_word_remover to dedupe whole words and text_duplicate_line_remover to dedupe whole lines. Runs locally on the text you provide: read-only, non-destructive, contacts no external service, and is rate-limited (60 requests/minute for anonymous callers). Returns the deduplicated string, before/after statistics (length, character and unique-character counts, count removed, reduction percent), the effective options, and a sample list of up to 20 removed duplicates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to deduplicate at the character level. Must not be blank. | |
| caseSensitive | No | When true, A and a count as different characters; when false, comparison is case-insensitive. | |
| preserveWhitespace | No | When true, every whitespace character is kept and never treated as a duplicate; when false, whitespace is deduplicated like any other character. | |
| firstOccurrence | No | When true, the first occurrence of each character is kept; when false, the last occurrence is kept. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | Whether deduplication succeeded. | |
| result | No | The deduplicated output text. | |
| stats | No | Before/after character statistics. | |
| options | No | The effective options applied (caseSensitive, preserveWhitespace, firstOccurrence). |