<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Subtract strings in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/subtract-strings/m-p/78623#M6354</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot. It works great.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jun 2011 12:31:15 GMT</pubDate>
    <dc:creator>BartłomiejStaroń</dc:creator>
    <dc:date>2011-06-22T12:31:15Z</dc:date>
    <item>
      <title>Subtract strings</title>
      <link>https://community.esri.com/t5/python-questions/subtract-strings/m-p/78621#M6352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have two columns of data with strings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;First colummn contains: xx&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Second colummn contains : test xx&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"test xx" - "xx" = "test"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to with a python in a simple way?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 04:59:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/subtract-strings/m-p/78621#M6352</guid>
      <dc:creator>BartłomiejStaroń</dc:creator>
      <dc:date>2011-06-22T04:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract strings</title>
      <link>https://community.esri.com/t5/python-questions/subtract-strings/m-p/78622#M6353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;col1 = "test xx"
col2 = "xx"
print "&amp;lt;%s&amp;gt;\n" % col1.replace(col2,"").strip()
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or use regular expressions to be much more precise, with the leading space and the xx at the end of the string.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import re
col1 = "test xx"
col2 = "xx"
pattern = re.compile(" ?xx$")
repl = ""
result = re.sub(pattern,repl,col1)
print "&amp;lt;%s&amp;gt; &amp;lt;%s&amp;gt; &amp;lt;%s&amp;gt;\n" % (col1,col2,result)

&amp;lt;test xx&amp;gt; &amp;lt;xx&amp;gt; &amp;lt;test&amp;gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:01:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/subtract-strings/m-p/78622#M6353</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2021-12-10T23:01:53Z</dc:date>
    </item>
    <item>
      <title>Re: Subtract strings</title>
      <link>https://community.esri.com/t5/python-questions/subtract-strings/m-p/78623#M6354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a lot. It works great.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jun 2011 12:31:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/subtract-strings/m-p/78623#M6354</guid>
      <dc:creator>BartłomiejStaroń</dc:creator>
      <dc:date>2011-06-22T12:31:15Z</dc:date>
    </item>
  </channel>
</rss>

