<?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: Remove text in parenthesis with Arcade in Developers Questions</title>
    <link>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538539#M3631</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked.  Thank you so much!&lt;/P&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 May 2019 19:58:54 GMT</pubDate>
    <dc:creator>JoanHickey</dc:creator>
    <dc:date>2019-05-01T19:58:54Z</dc:date>
    <item>
      <title>Remove text in parenthesis with Arcade</title>
      <link>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538537#M3629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python script to remove the text in parentheses for labeling, and I cannot figure out how to convert it to work with Arcade. (I did not write this script, but I am trying to get the same results in AGOL.&lt;/P&gt;&lt;P&gt;The Python script is: def FindLabel ( [label] &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&amp;nbsp; S =[label].strip()&lt;BR /&gt;&amp;nbsp; i = S.find('(')&lt;BR /&gt;&amp;nbsp; if i == -1:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return S.replace('::','\n')&lt;BR /&gt;&amp;nbsp; elif i &amp;gt; 0:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return S[0:i]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that Arcade does not have a strip function, so I was trying trim, and instead of the newline function, I was just typing a space.&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp; '82 (Globe)'&amp;nbsp; needs to be '82'&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2019 18:55:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538537#M3629</guid>
      <dc:creator>JoanHickey</dc:creator>
      <dc:date>2019-05-01T18:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove text in parenthesis with Arcade</title>
      <link>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538538#M3630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the Arcade &lt;A href="https://developers.arcgis.com/arcade/function-reference/text_functions/#split" rel="nofollow noopener noreferrer" target="_blank"&gt;Split&lt;/A&gt; function.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; array &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;split&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"("&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; array&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&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;/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>Sat, 11 Dec 2021 23:22:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538538#M3630</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2021-12-11T23:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Remove text in parenthesis with Arcade</title>
      <link>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538539#M3631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That worked.  Thank you so much!&lt;/P&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 May 2019 19:58:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538539#M3631</guid>
      <dc:creator>JoanHickey</dc:creator>
      <dc:date>2019-05-01T19:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Remove text in parenthesis with Arcade</title>
      <link>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538540#M3632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A small addition to the solution provided by Ken: if you are interested&amp;nbsp;in returning a numeric value, you might want to explicitely convert it to&amp;nbsp;a number. Also&amp;nbsp;the text you return would have a space at the end, since split on "(" will result in an array with two elements: "82 " and "Globe)". To avoid this you could include the Trim and Number functions, like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; array &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Split&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$feature&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;field&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string 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="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Number&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Trim&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;array&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&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="punctuation token"&gt;;&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:22:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538540#M3632</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T23:22:21Z</dc:date>
    </item>
    <item>
      <title>Re: Remove text in parenthesis with Arcade</title>
      <link>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538541#M3633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it.  Thank you for the additional information.&lt;/P&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2019 19:33:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/developers-questions/remove-text-in-parenthesis-with-arcade/m-p/538541#M3633</guid>
      <dc:creator>JoanHickey</dc:creator>
      <dc:date>2019-05-03T19:33:19Z</dc:date>
    </item>
  </channel>
</rss>

