string tuncation logic