function to create a reverse of a given character