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>
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.