Updated truncateString to not truncate if the length is shorter than len