Replacing Part or All of a String
In the next example, the replacement begins four characters from the end, and replaces two characters in the variable with a four-character string: CD is replaced with XXYY. This would yield "ABXXYYEF".
STRING = "ABCDEF" STRING[-4,2] = "XXYY"