@rajeshalwayswel wrote: yes, we have lot of ways to do this. But in interview asked me how can we do by only this function.
I suspect that if the interviewer was that specific and knowledgeable, or had a prepared list of answers, may have been looking for "Can't do that with Translate, you may have meant Tranwrd" since translate replaces all occurrences of specified characters with the specified target.
@rajeshalwayswel wrote: yes, we have lot of ways to do this. But in interview asked me how can we do by only this function.
I suspect that if the interviewer was that specific and knowledgeable, or had a prepared list of answers, may have been looking for "Can't do that with Translate, you may have meant Tranwrd" since translate replaces all occurrences of specified characters with the specified target.
If your suspicion is correct, I think this is a terrible interview question,and unfortunate for the interviewee, but that's my opinion. It could also be that whoever prepared the question him(her)self had confused TRANSLATE and TRANWRD, which would be doubly unfortunate for the interviewee.