Capgemini Interview Question

Replace a String with the numbers. Like abcd is a string replace it with 1234.