truncateString Extends the native JavaScript String class to add a truncate method. Can pass in a trailing text string if desired.