replace special charecters

Hi All,

I want to remove special character using ansible playbook, I can provide the sample data here below that I am trying to remove

“\nhostname username\n”\r

I want to remove \n and \r.

Looking forward for reply.

Regards
Sumit Sahay