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>
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.