<?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 trim half-width and full-width space</title><link>https://community.appian.com/discussions/f/general/26766/how-to-trim-half-width-and-full-width-space</link><description>Hi Guys. 
 
 Im trying to make a function where the string contains half-width and full-width spaces, the first and last spaces will be removed. 
 When i used the trim() function in appian it only trim(beginning and trail) half width spaces but if the</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to trim half-width and full-width space</title><link>https://community.appian.com/thread/105074?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 08:51:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7e688018-ff0c-4cf4-8c00-e3ec8cb9c2c1</guid><dc:creator>peanut</dc:creator><description>&lt;p&gt;I got it now, Thanks :). &lt;span&gt;Since&amp;nbsp;Appian uses&lt;/span&gt;&lt;span&gt;&amp;nbsp;Java regex flavor, all i need is to add the embedded (?U)&amp;nbsp; flag option to the pattern.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So my regex code looks like this:&amp;nbsp;regexreplaceall(&amp;quot;&lt;strong&gt;(?U)^\s+|\s+$&lt;/strong&gt;&amp;quot;, ri!targetValue, &amp;quot;&amp;quot;) .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;works like magic haha&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to trim half-width and full-width space</title><link>https://community.appian.com/thread/105073?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 08:43:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5d21cc09-d0c9-41eb-9baa-f79f554c4638</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/20641297/unicode-characters-in-regex"&gt;stackoverflow.com/.../unicode-characters-in-regex&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to trim half-width and full-width space</title><link>https://community.appian.com/thread/105072?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 08:42:16 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:63ece588-1884-4472-8388-03cd019062ed</guid><dc:creator>peanut</dc:creator><description>&lt;p&gt;Yes, Im still looking for regex code equivalent for fullwidth spaces.&lt;/p&gt;
&lt;p&gt;But do you have any suggestion or like other process to remove spaces including half and full width, Sir?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Full Width spaces/characters are used in Japanese text.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to trim half-width and full-width space</title><link>https://community.appian.com/thread/105071?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 08:35:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7998629c-2398-4fdb-88d1-7a011be2028a</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;I am really interested in your use case. Where do these fullwidth&amp;nbsp;spaces come from?&lt;/p&gt;
&lt;p&gt;You will need to modify the regex to your requirements.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to trim half-width and full-width space</title><link>https://community.appian.com/thread/105070?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 07:55:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:282bdade-3cf1-4ea1-a71a-3251d48ffe9f</guid><dc:creator>peanut</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I tried to used this function in appian and with this regex code value, that replaced leading and trailing spaces to &amp;quot;&amp;quot;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;regexreplaceall(&amp;quot;^\s+|\s+$&amp;quot;, ri!targetValue, &amp;quot;&amp;quot;)&lt;/p&gt;
&lt;p&gt;However when the value consist of fullwidth space like this &amp;quot;　　&amp;quot; -&amp;gt; unicode equilavent to&amp;nbsp;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;12288&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;Normal half width space is unicode 32.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;It only removes half width space., even using trim function in appian only removes half width space.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span class="CollapsibleOutputNode---print_value"&gt;So Im having problem on how to removed also the full width spaces.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to trim half-width and full-width space</title><link>https://community.appian.com/thread/105066?ContentTypeID=1</link><pubDate>Fri, 02 Dec 2022 07:10:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7a633198-56ba-41a8-a68c-a25bedc82a7e</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;From a typography perspective I fully understand what you try to do, but what is the use case?&lt;/p&gt;
&lt;p&gt;Did you consider using a regex? Something similar to this:&amp;nbsp;&lt;a href="https://stackoverflow.com/questions/1981349/regex-to-replace-multiple-spaces-with-a-single-space"&gt;stackoverflow.com/.../regex-to-replace-multiple-spaces-with-a-single-space&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>