<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Extract digits from string</title><link>https://community.appian.com/discussions/f/new-to-appian/29103/extract-digits-from-string</link><description>Hi Everyone, 
 I need to extract first four digits and last four digits from the given string. Like string is &amp;quot;sgdh567895dgh6787&amp;quot; then first four digits would be 5678 and last four are 6787. 
 Can anyone please help me out? 
 Many Thanks!</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Extract digits from string</title><link>https://community.appian.com/thread/114972?ContentTypeID=1</link><pubDate>Sun, 25 Jun 2023 12:06:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4ee0c0df-6ad6-4e5e-bbed-33fa81aac437</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;If you numbers are going to be less than 9 digits, then you can also use tointeger() instead of cleanwith()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Extract digits from string</title><link>https://community.appian.com/thread/114967?ContentTypeID=1</link><pubDate>Sun, 25 Jun 2023 11:44:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:af70929a-6168-443d-bd08-59dd5f5c1655</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Find the list of available function in Appian here:&amp;nbsp;&lt;a href="https://docs.appian.com/suite/help/23.2/Appian_Functions.html"&gt;https://docs.appian.com/suite/help/23.2/Appian_Functions.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I quickly put together a snippet:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!value: &amp;quot;sgdh567895dgh6787&amp;quot;,
  local!clean: cleanwith(local!value, &amp;quot;0123456789&amp;quot;),
  a!map(
    firstFour: left(local!clean, 4),
    lastFour: right(local!clean, 4)
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>