which method can be used to replace parts of a string in Python code example
Example 1: python replace "\" for "/"
my_string = r'\\ServerA\DriveB\5.FolderC\A.TXT'
my_string = my_string.replace('\\', '/')
Example 2: set replace python
# Replace 1 with 4
s = {1, 2, 3}
s.remove(1)
s.add(4)