org-shorten-string

org-shorten-string is a compiled Lisp function in `org.el'.

(org-shorten-string S MAXLENGTH)

Shorten string S so tht it is no longer than MAXLENGTH characters.
If the string is shorter or has length MAXLENGTH, just return the
original string. If it is longer, the functions finds a space in the
string, breaks this string off at that locations and adds three dots
as ellipsis. Including the ellipsis, the string will not be longer
than MAXLENGTH. If finding a good breaking point in the string does
not work, the string is just chopped off in the middle of a word
if necessary.