another solution of string reverse