The convert() function searches a given variable and replaces each occurrence of a character by another.
convert(var, str.exp1, str.exp2)
var | Variable in which the specified string will be searched and replaced. |
str.exp1 | Specifies the characters to be replaced with the corresponding replacement characters from str.exp2. |
str.exp2 | Specifies the characters to replace the characters specified in str.exp1. |
Any character designated in str.exp1 is replaced with the corresponding replacement character from str.exp2. The correspondence is by column position in str.exp1 and str.exp2.
If the length of str.exp1 is shorter than str.exp2, all characters in str.exp2 beyond the length of str.exp1 are ignored.
If the length of str.exp1 is longer than str.exp2, all characters in str.exp1 beyond the length of str.exp1 are deleted from the result.