added truncate method to String