<?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 Mid() function in Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788387#M1506</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the Python Mid() function to return&amp;nbsp;strings starting&amp;nbsp;at the 5th character.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I have tried&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;!STR_NAME!.Mid(5:20)&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;but that gives me a traceback error&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Can someone point me in the right direction?&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Oct 2019 17:55:30 GMT</pubDate>
    <dc:creator>SLouq</dc:creator>
    <dc:date>2019-10-31T17:55:30Z</dc:date>
    <item>
      <title>Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788387#M1506</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use the Python Mid() function to return&amp;nbsp;strings starting&amp;nbsp;at the 5th character.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;I have tried&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;!STR_NAME!.Mid(5:20)&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;but that gives me a traceback error&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Can someone point me in the right direction?&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 17:55:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788387#M1506</guid>
      <dc:creator>SLouq</dc:creator>
      <dc:date>2019-10-31T17:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788388#M1507</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Never heard of the mid() functin and couldn't find it with dr. google.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;myString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'abcdefghijklmnopqrstuvwxyz'&lt;/SPAN&gt;
x &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; myString&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;x&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#returns 'fghijklmnopqrst'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;This works for me...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788388#M1507</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T09:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788389#M1508</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how do I use that expression on a Field in ArcGIS Pro so it returns values starting at the 5th character?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 18:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788389#M1508</guid>
      <dc:creator>SLouq</dc:creator>
      <dc:date>2019-10-31T18:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788390#M1509</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Slice lesson&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# ---- python slicing... &lt;/SPAN&gt;

b &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"abcdefghijklmnopqrstuvwxyz"&lt;/SPAN&gt;

str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'fghijklmnopqrst'&lt;/SPAN&gt;

str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'fghijklmnopqrstuvwxyz'&lt;/SPAN&gt;

str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'vwxyz'&lt;/SPAN&gt;

str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;b&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'abcde'&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;# ---- why use str????&lt;/SPAN&gt;

str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;None&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="string token"&gt;'No'&lt;/SPAN&gt;

None&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
Traceback &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;most recent call last&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

  File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-18-5a2d59b27828&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;module&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;
    None&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

TypeError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'NoneType'&lt;/SPAN&gt; object &lt;SPAN class="keyword token"&gt;is&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;not&lt;/SPAN&gt; subscriptable&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788390#M1509</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-12T09:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788391#M1510</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See Dan's suggestions below... or:&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="language-python line-numbers"&gt;&lt;CODE&gt;str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;!FieldName!&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;resources for you:&amp;nbsp;&lt;A class="link-titled" href="https://www.pythoncentral.io/cutting-and-slicing-strings-in-python/" title="https://www.pythoncentral.io/cutting-and-slicing-strings-in-python/"&gt;Cutting and slicing strings in Python - Python Central&lt;/A&gt;&amp;nbsp;,&amp;nbsp;&lt;A class="link-titled" href="https://www.programiz.com/python-programming/methods/built-in/str" title="https://www.programiz.com/python-programming/methods/built-in/str"&gt;Python str() - Python Standard Library&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 19:26:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788391#M1510</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-10-31T19:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788392#M1511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;as per the lesson... 'b' is anything&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;like str(&lt;SPAN style="display: inline !important; float: none; background-color: #ffffff; color: #3d3d3d; font-family: inherit; font-size: 100%; font-style: inherit; font-variant: normal; font-weight: inherit; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;!STR_NAME!&lt;/SPAN&gt;)[5:20]&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/wink.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 19:39:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788392#M1511</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-10-31T19:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788393#M1512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys! I got it to execute but it erased more chars than I wanted. Now I just have to re run the models and change the parameters around when I get to this point.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 19:45:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788393#M1512</guid>
      <dc:creator>SLouq</dc:creator>
      <dc:date>2019-10-31T19:45:46Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788394#M1513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sometimes you just need to fiddle with the indexes to get it just right...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 19:59:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788394#M1513</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2019-10-31T19:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788395#M1514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That program is buggy as hell. I started my whole model again from the beginning and it stopped when it got to this part with the same error &lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;but yet it worked when I tried it while we were discussing in this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 20:26:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788395#M1514</guid>
      <dc:creator>SLouq</dc:creator>
      <dc:date>2019-10-31T20:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788396#M1515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Indexes&amp;nbsp;can have a sense of humor.&amp;nbsp; Consider:&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;myString &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'abcdefg'&lt;/SPAN&gt;

str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myString&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#'bc' what I really wanted was 'bcd' so what I should have used is:&lt;/SPAN&gt;

str&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myString&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#'bcd'&lt;/SPAN&gt;

len&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;myString&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#7&lt;/SPAN&gt;

myString&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#Traceback (most recent call last):&lt;/SPAN&gt;

  &lt;SPAN class="comment token"&gt;#File "&amp;lt;ipython-input-12-4e9d2e9a673c&amp;gt;", line 1, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;
    &lt;SPAN class="comment token"&gt;#myString[7]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#IndexError: string index out of range&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;When you want specific characters out of a string, you need to really consider which ones you want....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:00:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788396#M1515</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-12T09:00:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788397#M1516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;do it manually (assuming that you have to do this whole process many times)&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;get it right, then put in the model in order to rule out other stuff like overwriting outputs etc etc.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;The error message would also help.&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;Also python is 0 based so a[:5] will slice the 0, 1, 2, 3, 4 characters, hence :5 means beyond the 5th character&lt;/P&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;P&gt;a[5:10] means beyond the 5th and up to, but not including the 10th (5, 6, 7, 8, 9), that is, 5 characters (10 - 5)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Oct 2019 21:31:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788397#M1516</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-10-31T21:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mid() function in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788398#M1517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for helping me guys! &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Nov 2019 12:45:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/mid-function-in-python/m-p/788398#M1517</guid>
      <dc:creator>SLouq</dc:creator>
      <dc:date>2019-11-01T12:45:43Z</dc:date>
    </item>
  </channel>
</rss>

