$maxLength = the maximum length of the string (not including $elipses)
$offset = starting position
$elipses = string to append to end of the string
Only problem with it is having to know the length of the string. But there's some template functions to calculate that too, I think. But hopefully the length of the strings are predictable.