Password encrypt and send mail

Hi team I have one password is available like 1234557890 or 1234567 but I need to convert that password into encrypt like if password length is 10 digits or 9 digits but needs convert like xxxxxxxx89 or xxxxxx89 and it send it that password in mail body


Do you want to replace all the values apart from the last two with x and send? Is that the requirement?

If yes then try this…say str is a variable where the required password is stored

Now use assign as below

Str = StrDup(str.Length-2,"x") + str.Substring(str.Length-2)



Yes anil thank you replay actually my input will come like from 4 digits to 10 digits whatever num is there i need i need to convert like that


This works for any length greater than 3…

Hope that helps

Please mark solution if resolved…else happy to help


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.