Improved reduce string to add ellipsis.