replace \ python code example Example: python replace "\" for "/" my_string = r'\\ServerA\DriveB\5.FolderC\A.TXT' my_string = my_string.replace('\\', '/')