Made string truncation a general-purpose string extension.