<?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>Remove Duplicates Letters</title><link>https://community.appian.com/discussions/f/general/39365/remove-duplicates-letters</link><description>How to remove duplicate letters from the string without changing case of letters 
 input &amp;quot;Deleted&amp;quot; 
 output &amp;quot;Delt&amp;quot;</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Remove Duplicates Letters</title><link>https://community.appian.com/thread/151919?ContentTypeID=1</link><pubDate>Thu, 09 Oct 2025 09:02:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e9f6b1c5-52ee-4f2f-9fc6-6d0cee54b331</guid><dc:creator>Vicky Rudraram</dc:creator><description>&lt;p&gt;An alternate solution&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!word: &amp;quot;DeletEd&amp;quot;,
  local!letters: char(code(local!word)),
  local!uniq: union(local!letters, local!letters),
  local!result: a!forEach(
    local!uniq,
  
    wherecontains(1, search(fv!item, local!uniq))[1]
  ),
  index(
    local!uniq,
    union(local!result, local!result),
    {}
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Duplicates Letters</title><link>https://community.appian.com/thread/149432?ContentTypeID=1</link><pubDate>Mon, 30 Jun 2025 14:50:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e9838fa3-2bf1-4e8b-ba22-a6871b4b6fd0</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;If the text has different cases like in &amp;quot;Deleted&amp;#39; - d comes twice in lower as well as upper case -&amp;nbsp; then this does not yield expected output.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Duplicates Letters</title><link>https://community.appian.com/thread/149415?ContentTypeID=1</link><pubDate>Mon, 30 Jun 2025 12:11:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c7009444-3bb9-4198-bf8c-f7e5e5c486ea</guid><dc:creator>sureshs276515</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="/members/vickyr583585"&gt;Vicky Rudraram&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;you can try with below code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;a!localVariables(&lt;br /&gt; local!input: &amp;quot;appian&amp;quot;,&lt;br /&gt; local!chars: char(code(local!input)),&lt;br /&gt; local!char: a!forEach(&lt;br /&gt; items: union(local!chars, local!chars),&lt;br /&gt; expression: left(cleanwith(local!input, fv!item), 1),&lt;br /&gt; &lt;br /&gt; ),&lt;br /&gt; joinarray(local!char)&lt;br /&gt;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Duplicates Letters</title><link>https://community.appian.com/thread/149404?ContentTypeID=1</link><pubDate>Mon, 30 Jun 2025 06:42:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56371e7b-4f5c-4a0f-9757-4b4696cee8ab</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;A shorter version. I&amp;nbsp;check each character whether it already is part of the substring before&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!text: &amp;quot;Deleted&amp;quot;,
  joinarray(
    a!foreach(
      items: enumerate(len(local!text)),
      expression: if(
        a!isInText(left(local!text, fv!item), local!text[fv!index]),
        &amp;quot;&amp;quot;,
        local!text[fv!index]
      )
    ),
    &amp;quot;&amp;quot;
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Remove Duplicates Letters</title><link>https://community.appian.com/thread/149400?ContentTypeID=1</link><pubDate>Sun, 29 Jun 2025 20:13:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9a095012-ed25-45e4-a8c0-f02d03c28d41</guid><dc:creator>Harsha Sharma</dc:creator><description>&lt;p&gt;With the use of functions and loops this can be achieved. First you need to split the text into a character array. Then remove the duplicates from the character array. Result will have unique characters - uppercase and lowercase will be in this array as they are unique still! Lastly we identify/reject the duplicates doing a case match and return the output as expected, in the same case and order as present in original text.&lt;/p&gt;
&lt;p&gt;Below is a code with the solution for this interesting question.&amp;nbsp;Hope it helps!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!text: &amp;quot;Deleted&amp;quot;,
  local!charArray: a!foreach(
    enumerate(len(local!text)) + 1,
    local!text[fv!item]
  ),
  local!unique: union(local!charArray, local!charArray),
  joinarray(
    a!foreach(
      local!unique,
      if(
        fv!isFirst = 1,
        fv!item,
        if(
          length(
            wherecontains(lower(fv!item), lower(local!unique))
          ) &amp;gt; 1,
          {},
          fv!item
        )
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>