<?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>How to replace first 5 digit with * and remaining number will same ?</title><link>https://community.appian.com/discussions/f/general/21596/how-to-replace-first-5-digit-with-and-remaining-number-will-same</link><description>Hi, 
 I have to pass 10 digit number in the rule input, how to replace first 5 digit number with * and remaining 5 digit will same ?</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to replace first 5 digit with * and remaining number will same ?</title><link>https://community.appian.com/thread/84448?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 07:55:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:49426a10-a8f4-4d7e-b484-9e10d9581343</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;This will achieve what you&amp;#39;ve expressed:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!concat(&amp;quot;XXXXX&amp;quot;, fn!right(ri!myNumber, 5))&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Note: it&amp;#39;s best practice to encapsulate literals in constants so that a) their value can be maintained independently of the code where they&amp;#39;re used and b) so that, by giving the constant a meaningful name, the code becomes more readable. e.g. instead of &amp;quot;XXXXX&amp;quot; you may have cons!PROJECT_PREFIX_TELEPHONE_NUMBER_MASKING_VALUE (or whatever is meaningful in your context). And now that you have the value in a constant you could interrogate that constant for it&amp;#39;s length and use that value&amp;nbsp;instead of the literal 5, so if the masking string in your constant ever changes in value or length the code will continue to work:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;fn!concat(
  cons!PROJECT_PREFIX_TELEPHONE_NUMBER_MASKING_VALUE,
  fn!right(
    ri!myNumber,
    fn!len(
      cons!PROJECT_PREFIX_TELEPHONE_NUMBER_MASKING_VALUE
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace first 5 digit with * and remaining number will same ?</title><link>https://community.appian.com/thread/84447?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 07:54:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:87756df3-1a33-446a-a81b-cd3f31024058</guid><dc:creator>Acacio Barrado</dc:creator><description>&lt;p&gt;Hi there,&lt;/p&gt;
&lt;p&gt;There are multiple ways that you could achieve that, but you can try the code below to give you some idea:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;replace(1234567890,1,5,&amp;quot;*****&amp;quot;)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Just replace the numbers for your rule input.&lt;/p&gt;
&lt;p&gt;Hope that helps.&lt;/p&gt;
&lt;p&gt;Acacio B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>