Added functions for string truncation