Also, the rest of the code snippet (manually searching the string for an "X") is pointless. The replace it going to do it's own search (and not replace anything of no "x" is found). The entire thing can be replace with just
str1 = str1.Replace("x", ara);
|