col1 = "test xyz" col2 = "xyz" print "<%s>\n" % col1.replace(col2,"").strip()
import re col1 = "test xyz" col2 = "xyz" pattern = re.compile(" ?xyz$") repl = "" result = re.sub(pattern,repl,col1) print "<%s> <%s> <%s>\n" % (col1,col2,result) <test xyz> <xyz> <test>
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.