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>
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.