Function that reverses string