How to truncate a string intelligently
substring(text from 1 for (110 - length(substring_index(substring(text from 1 for 110),' ', -1)))) as text
will strip until the last word, which competely fits into less than 110 chars. No truncating in the middle of words or even worse, entities.
Add Comment