Delphi truncate string. I tried using the while loop .