Adds a string truncate method