Handle empty strings during truncation