Tech Mahindra Interview Question

Write a code to reverse a string?