Hi, i need to do some character replacements in a string.
heres what i have to do, lets say i have the string x= ABCD
i would have to change the character at index 0 to 1, then at 2 to 4, and so on.
i tried to do x.replace(x.cha rAt(0), x.charAt(1)), but then what happened was if the characters in the string were the same, it replaced all of them by the character at one.
does anyone know how i could do this so this doesn 't happen.
thanks
kate
heres what i have to do, lets say i have the string x= ABCD
i would have to change the character at index 0 to 1, then at 2 to 4, and so on.
i tried to do x.replace(x.cha rAt(0), x.charAt(1)), but then what happened was if the characters in the string were the same, it replaced all of them by the character at one.
does anyone know how i could do this so this doesn 't happen.
thanks
kate
Comment