I'm trying to define a function in python to replace some items in a string. My string is a string that contains degrees minutes seconds (i.e. 216-56-12.02)
I want to replace the dashes so I can get the proper symbols, so my string will look like 216° 56' 12.02"
I tried this:
def FindLabel ([Direction]):
s = [Direction]
s = s.replace("-","° ",1) #replace first instancwe of the dash in the original string
s = s.replace("-","' ") # replace the remaining dash from the last string
s = s + """ #add in the minute sign at the end
return s
This doesn't seem to work. I'm not sure what's going wrong. Any suggestions are welcome.
Cheers, Mike