I need to remove forward slashes from the attributes in a layer. I need to remove the first \ and last \ and replace the double \\ with just one \. I would appreciate any help. Thanks.
Currently the attributes looks like this.
I need it to look like the following
I tried the following but got error "TypeError: argument of type 'NoneType' is not iterable" on line if '\\' if '\\' in row: #if a double quote is in the string returned.
with arcpy.da.UpdateCursor("In_memory\LayerTest", "ZONING_CODE") as cursor:
for row in cursor:
if '\\' in row: #if a double quote is in the string returned,
row=row.replace('\\','\\') #replace that double quote with an empty string (removes it)