Truncate API
Truncate text cleanly. Cut a string to a maximum number of characters — at the end, the start or the middle — breaking on word boundaries so words are never chopped in half, and adding an ellipsis (which counts toward the limit). Middle truncation keeps the start and end and elides the centre, ideal for long file paths and IDs. A words endpoint trims to a number of whole words instead. Everything is emoji- and Unicode-safe (it counts code points, not bytes), so multi-byte characters and emoji are never split. Perfect for previews and teasers, table cells and cards, meta descriptions, breadcrumbs and CLI output. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. Distinct from word wrapping, case conversion and text statistics.
api.oanor.com/truncate-api