Tech Mahindra interview question

Write a code to reverse a string?