shortenStr function

Shorten strings to a given number of characters