<?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 special character in string</title><link>https://community.appian.com/discussions/f/general/12453/how-to-replace-special-character-in-string</link><description>I have the string with multiple repeated special characters which needs to be replaced with another character. 
 
 Eg: s&amp;#39;d&amp;#39;g&amp;#39; has to be replaced with s@d@g@. 
 
 Please suggest.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/65284?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 04:31:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02ce25ad-4a53-4a69-83d5-e72b68c9d4cb</guid><dc:creator>RijutaGhosh</dc:creator><description>Substitute function should be used&lt;br /&gt;
substitute(&amp;quot;s&amp;#39;d&amp;#39;g&amp;quot;,&amp;quot;&amp;#39;&amp;quot;,&amp;quot;@&amp;quot;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55818?ContentTypeID=1</link><pubDate>Tue, 29 May 2018 02:55:46 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8e9f90d2-1c81-4790-bdf6-92699ec6d66c</guid><dc:creator>Roopesh Rambhatla</dc:creator><description>I agree with others using substitute as the right way of replacing special characters , There is another funny way to do the same functionality,&lt;br /&gt;
&lt;br /&gt;
with(&lt;br /&gt;
  local!a: &amp;quot;s&amp;#39;d&amp;#39;g&amp;#39;&amp;quot;,&lt;br /&gt;
  local!b: a!forEach(&lt;br /&gt;
    items: reject(&lt;br /&gt;
      fn!isnull,&lt;br /&gt;
      split(&lt;br /&gt;
        local!a,&lt;br /&gt;
        &amp;quot;&amp;#39;&amp;quot;&lt;br /&gt;
      )&lt;br /&gt;
    ),&lt;br /&gt;
    expression: concat(&lt;br /&gt;
      fv!item,&lt;br /&gt;
      &amp;quot;@&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
  ),&lt;br /&gt;
  joinarray(&lt;br /&gt;
    local!b&lt;br /&gt;
  )&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
	&lt;br /&gt;
&amp;quot;s@d@g@&amp;quot;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55366?ContentTypeID=1</link><pubDate>Mon, 21 May 2018 05:52:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b03f9087-07e5-4501-bc3c-2d6a75e03404</guid><dc:creator>Aswini </dc:creator><description>Hi saic,&lt;br /&gt;
For replacing special characters in string you can use substitute() function.&lt;br /&gt;
&lt;br /&gt;
for example : substitute(&amp;quot;A&amp;#39;P&amp;#39;P&amp;#39;I&amp;#39;A&amp;#39;N&amp;quot;,&amp;quot;&amp;#39;&amp;quot;,&amp;quot;@&amp;quot;). The output will be A@P@P@I@A@N&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://docs.appian.com/suite/help/18.1/fnc_text_substitute.html"&gt;docs.appian.com/.../fnc_text_substitute.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55343?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 17:49:58 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:059b5338-25a2-4e0b-8476-9c461eacf333</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Since nobody&amp;#39;s said so already, I suggest you check out the function &lt;strong&gt;&lt;em&gt;substitute()&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;j/k&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Seriously though, I would like to offer the following expression rule which you can use to do multiple simultaneous substitutions.&amp;nbsp; It accepts 2 equal-length arrays, ri!originalValues which will be replaced by the members of ri!replacementValues.&amp;nbsp; Original text is ri!inputText.&lt;/p&gt;
&lt;pre&gt;if(&lt;br /&gt;&amp;nbsp; count(ri!originalValues) &amp;lt;&amp;gt; count(ri!replacementValues),&lt;br /&gt;&amp;nbsp; ri!inputText,&lt;br /&gt;&amp;nbsp; reduce(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fn!substitute,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ri!inputText,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; merge( ri!originalValues, ri!replacementValues )&lt;br /&gt;&amp;nbsp; )&lt;br /&gt;)&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55333?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 09:18:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:71fa620e-8a8d-4072-a51b-2cc9ecb7980b</guid><dc:creator>Shanmukha</dc:creator><description>substitute is the only one function that should be used in this case since it uses the java string method int he background. other methods all little tricky and time consumable.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55332?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 09:18:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:167fbead-1e03-4417-befa-0ce367d41658</guid><dc:creator>Shanmukha</dc:creator><description>substitute is the only one function that should be used in this case since it uses the java string method int he background. other methods all little tricky and time consumable.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55330?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 06:29:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a49395a8-6380-4af6-a02d-eaebf492b761</guid><dc:creator>sahilb346</dc:creator><description>Hello &lt;br /&gt;
&lt;br /&gt;
We also had this kind of requirement and we used substitute function. You can try substitute().&lt;br /&gt;
&lt;br /&gt;
Thanks&lt;br /&gt;
Sahil Batra&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55328?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 05:44:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dc1d5c6a-5535-4a50-aaa7-3df06ccfdb56</guid><dc:creator>aratim</dc:creator><description>Hi,&lt;br /&gt;
Substitute function can be useful to get the required output:&lt;br /&gt;
Link for more info: &lt;a href="https://docs.appian.com/suite/help/18.1/fnc_text_substitute.html"&gt;docs.appian.com/.../fnc_text_substitute.html&lt;/a&gt;&lt;br /&gt;
Input: substitute(&amp;quot;s&amp;#39;d&amp;#39;g&amp;#39;&amp;quot;,&amp;quot;&amp;#39;&amp;quot;,&amp;quot;@&amp;quot;)&lt;br /&gt;
Output : s@d@g@&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55327?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 05:33:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c8ff4732-2447-4848-ae2d-1d5bf5b9fe02</guid><dc:creator>krishnau3863</dc:creator><description>Hi saic929,&lt;br /&gt;
&lt;br /&gt;
                you can use the substitute function for this requirement.&lt;br /&gt;
&lt;br /&gt;
 substitute(text, find, replace_with, instance_num) &lt;br /&gt;
&lt;br /&gt;
 substitute(&amp;quot;s&amp;#39;d&amp;#39;g&amp;#39;&amp;quot;,&amp;quot;&amp;#39;&amp;quot;,&amp;quot;@&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
 output:  &amp;quot;s@d@g@&amp;quot;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55324?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 04:44:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:224344f3-7e41-4449-94c5-732b49abb9f4</guid><dc:creator>ravalik</dc:creator><description>Hi saic,&lt;br /&gt;
&lt;br /&gt;
As per my level of understanding you can use substitute function as it only substitutes specified part of the string .&lt;br /&gt;
&lt;a href="https://docs.appian.com/suite/help/18.1/fnc_text_substitute.html"&gt;docs.appian.com/.../fnc_text_substitute.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
ravalik&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to replace special character in string</title><link>https://community.appian.com/thread/55318?ContentTypeID=1</link><pubDate>Fri, 18 May 2018 03:11:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:01c3ed72-f8bd-40ad-b689-01b7925c419f</guid><dc:creator>chandhinir</dc:creator><description>hi,&lt;br /&gt;
substitute function can be used to get the output like below:&lt;br /&gt;
&lt;br /&gt;
substitute(&amp;quot;s&amp;#39;ss&amp;#39;s&amp;quot;,&amp;quot;&amp;#39;&amp;quot;,&amp;quot;@&amp;quot;) --&amp;gt;&amp;quot;s@ss@s&amp;quot;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>