<?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>want to convert &amp;quot;indiaChinaFrance&amp;quot; to &amp;quot;India China France&amp;quot;</title><link>https://community.appian.com/discussions/f/general/22347/want-to-convert-indiachinafrance-to-india-china-france</link><description>want to display dynamic field name on screen but with updating initial as capital and adding one space in between.Field name always start with small caps 
 eg. &amp;quot;indiaChinaFrance&amp;quot; to &amp;quot;India China France&amp;quot; 
 eg. abcDefXyz to &amp;quot;Abc Def Xyz&amp;quot;</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87565?ContentTypeID=1</link><pubDate>Wed, 03 Nov 2021 06:15:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b6672277-829c-4bd1-aac4-22496b82b5d1</guid><dc:creator>Acacio Barrado</dc:creator><description>&lt;p&gt;Sorry I&amp;#39;m late in the party but also want to contribute.&lt;/p&gt;
&lt;p&gt;I like your idea to use regex Selva. That is my idea:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!a: &amp;quot;indiaChinaFrance&amp;quot;,
  local!b: regexinsertmatchmarkers(&amp;quot;([A-Z])&amp;quot;, local!a, &amp;quot; &amp;quot;, null, false(), &amp;quot;g&amp;quot;),
  local!b
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Acacio B.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87488?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 18:18:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:65cd2843-bcd3-4f1b-b688-d62729e1e751</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;As I feel the community pressure here:&amp;nbsp;&lt;br /&gt;my shot:&amp;nbsp;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!countryString: &amp;quot;indiaChinaFrance&amp;quot;,
  local!brackets: append(
    a!forEach(
    items: enumerate(len(local!countryString))+1,
      expression: a!localVariables(
        local!charUnicode: code(charat(local!countryString,fv!index)),
        if(
          and(
            local!charUnicode=&amp;lt;90,
            local!charUnicode&amp;gt;=65
          ),
          fv!item,
          {}
        )
      )
    ),
    len(local!countryString)
  ),
  a!forEach(
    items: local!brackets,
    expression: if(
      fv!isFirst,
      concat(upper(charat(local!countryString,1)),mid(local!countryString,2,fv!item-2)),
      if(
        fv!isLast,
        mid(local!countryString,local!brackets[fv!index-1],fv!item+1-local!brackets[fv!index-1]),
        mid(local!countryString,local!brackets[fv!index-1],fv!item-local!brackets[fv!index-1])
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;okaaaay its not really easier than stefans &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87484?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 17:06:04 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bec29669-b0bd-42e3-bdf4-90c936896a81</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;index(
  index(
    index(
      reduce(
        merge(
          apply(
            index(
              if(
                merge(
                  merge(
                    ...&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;*shudder*&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87469?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 15:38:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:16edf6a1-30e3-41df-b060-cd2cbffed183</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;#JobSecurity&amp;nbsp;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f606.svg" title="Laughing"&gt;&amp;#x1f606;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It is a beautiful piece of code though!&amp;nbsp; Not sure I even knew the proper() function existed until now..&lt;/p&gt;
&lt;p&gt;Might as well include my solution here also &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;a!localVariables(
  local!input: &amp;quot;indiaChinaFrance&amp;quot;,
  joinarray(
    a!forEach(
      items: enumerate(len(local!input)),
      expression: a!localVariables(
        local!char: charat(local!input,fv!index),
        if(
          fv!isFirst,
          upper(local!char),
          if(
            code(local!char)&amp;lt;97,
            concat(&amp;quot; &amp;quot;,local!char),
            local!char
          )
        )
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87445?ContentTypeID=1</link><pubDate>Sun, 31 Oct 2021 11:18:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:256fc23d-3b05-469d-a682-5dcde6a4143b</guid><dc:creator>Richard Michaelis</dc:creator><description>&lt;p&gt;Stefaaaaaan &lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f602.svg" title="Joy"&gt;&amp;#x1f602;&lt;/span&gt;&amp;nbsp; I am not mike, but&amp;nbsp; I remember during our last call I mentioned the factor of maintainability regarding coding :D &lt;br /&gt;perhaps that is the most elegant way of all the above, but absolutly hell for people who shall maintain that.&amp;nbsp; &amp;quot;reduce&amp;quot; in combination of merge and on top (multiple) &amp;quot;_&amp;quot; is definitly not inituive to read....&amp;nbsp;&lt;span class="emoticon" data-url="https://community.appian.com/cfs-file/__key/system/emoji/1f600.svg" title="Grinning"&gt;&amp;#x1f600;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87443?ContentTypeID=1</link><pubDate>Sat, 30 Oct 2021 10:47:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8b5e5810-6952-4299-9971-ca340e0fcf4f</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Could not hold me back. My looping function solution.I am sure Mike will love it ;-)&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!input: &amp;quot;indiaChinaFrance&amp;quot;,
  proper(
    reduce(
      substitute(_, _, _),
      local!input,
      merge(
        char(65+enumerate(26)),
        apply(concat(&amp;quot; &amp;quot;, _), char(65+enumerate(26)))
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87430?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 15:07:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bf4830af-3190-4cd1-ae8c-703bbb69af62</guid><dc:creator>Selvakumar Kumarasamy</dc:creator><description>&lt;p&gt;I&amp;nbsp;thought of using regex &amp;amp; here&amp;#39;s my solution:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!newString: regexreplaceall(
    &amp;quot;([A-Z]+)*([A-Z][a-z])&amp;quot;,
    ri!string,
    &amp;quot;$1 $2&amp;quot;
  ),
  replace(
    local!newString,
    1,
    1,
    upper(left(local!newString, 1))
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87429?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 14:57:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1da6d920-69ad-4822-9f70-f761efbc613f</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;yeah i agree, in a more complete implementation the if() logic should check that the current character is in the range of uppercase alphabetical letters, whereas in my quick-fix approach i just made checked that the current character&amp;#39;s ascii code is lower than the lowest lowercase (since the ascii codes for uppercase characters are lower than the ones for lowercase, for anyone unfamiliar).&lt;/p&gt;
&lt;p&gt;Attached is the less lazy way:&lt;br /&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  /*local!lowerCaseA: code(&amp;quot;a&amp;quot;),*/
  local!upperCaseA: code(&amp;quot;A&amp;quot;),
  local!upperCaseZ: code(&amp;quot;Z&amp;quot;),
  
  local!inputString: &amp;quot;indiaChinaFrance&amp;quot;,
  
  local!codeArray: code(local!inputString),
  
  local!modifiedString: concat(a!forEach(
    local!codeArray,
    if(
      and(
        fv!item &amp;gt;= local!upperCaseA,
        fv!item &amp;lt;= local!upperCaseZ
      ),
      &amp;quot; &amp;quot; &amp;amp; char(fv!item),
      if(
        fv!isFirst,
        upper(char(fv!item)),
        char(fv!item)
      )
    )
  )),
  
  local!modifiedString
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87427?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 14:52:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:158a960b-9afa-438a-8c5f-244e3a143665</guid><dc:creator>Hemant Borate</dc:creator><description>&lt;p&gt;Thank &lt;a href="/members/mikes0011"&gt;Mike Schmitt&lt;/a&gt; It&amp;#39;s working&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87425?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 14:33:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:702d97c5-3396-48be-af67-41ea2f013489</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;Yup, I think this is a more robust solution than mine...although if you ONLY want the delimiters to be Capital Letters then you&amp;#39;d need to exclude all those characters who have letters &amp;lt; A&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87424?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 14:31:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dac9794f-75ce-4f4c-b10b-295c31252447</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;a!localVariables(
  local!lowerCaseA: code(&amp;quot;a&amp;quot;),
  
  local!inputString: &amp;quot;indiaChinaFrance&amp;quot;,
  
  local!codeArray: code(local!inputString),
  
  local!modifiedString: concat(a!forEach(
    local!codeArray,
    if(
      fv!item &amp;lt; local!lowerCaseA,
      &amp;quot; &amp;quot; &amp;amp; char(fv!item),
      if(
        fv!isFirst,
        upper(char(fv!item)),
        char(fv!item)
      )
    )
  )),
  
  local!modifiedString
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/11/pastedimage1635517867189v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87423?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 14:15:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f8da99ff-4ad3-46a7-9d65-c2c5e1c370e9</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Assuming we&amp;#39;ll always (and only) split on uppercase characters versus lowercase characters, this seems like a good place to (ab)use code() and char() conversions...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87421?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 13:32:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:14bf9372-8a11-471d-baa4-590a21ac0735</guid><dc:creator>Hemant Borate</dc:creator><description>&lt;p&gt;@&lt;a class="internal-link view-user-profile" href="/members/stewart.burchell"&gt;Stewart&lt;/a&gt;&amp;nbsp;let me try&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: want to convert "indiaChinaFrance" to "India China France"</title><link>https://community.appian.com/thread/87420?ContentTypeID=1</link><pubDate>Fri, 29 Oct 2021 13:13:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:33069f00-5783-4045-ac13-77def148b3b7</guid><dc:creator>Stewart Burchell</dc:creator><description>&lt;p&gt;I&amp;#39;m sure there are easier ways (awaits others to gleefully provide simpler solutions) but here&amp;#39;s my offering:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!items: { &amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;, &amp;quot;E&amp;quot;, &amp;quot;F&amp;quot; },
  local!splitAttribute: fn!reduce(fn!split, ri!attributeName, local!items),
  a!forEach(
    items: local!splitAttribute,
    expression: if(
      fv!isFirst,
      fn!proper(fv!item),
      fn!concat(
        ri!attributeName[fn!find(fv!item, ri!attributeName, 1) - 1],
        fv!item
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The idea is to have the full set of characters that you want to use as delimiters in the string you want to process (I&amp;#39;ve only provide A-F as an example).&lt;/p&gt;
&lt;p&gt;You then split the incoming string based upon that list. Unfortunately (j this instance) the split function excludes the value you&amp;#39;re splitting, so you up wiht a list where the first item is whole but the remaining items are missing their first character.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The aim of the remainder of the code is&amp;nbsp;to re-append the missing character to each item in the list generated by the split processing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>