guides:programming:programmers_reference_manual:replacing_part_or_all_of_a_string

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"


  • guides/programming/programmers_reference_manual/replacing_part_or_all_of_a_string.txt
  • Last modified: 2024/06/19 20:20
  • by 127.0.0.1