how to trim half-width and full-width space

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 spaces are full width it will not trim.

so i tried to trim and use the substitute function like this:

trim(substitute(ri!value," "," " )). 

It does trim the value perfectly, but it will also substitute the spaces in between the value where it shouldnt be.

Example process:

"<full-wdith spaces>he<full-wdith spaces>ll<full-wdith spaces>"

after executing the process: trim(substitute(ri!value," "," " ))

result: "he<half wdith space>ll"

expected output should be : "he<full-wdith spaces>ll"

Do you have any other idea to perform the desired process?

Thank You guys Cry

  Discussion posts and replies are publicly visible