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

Parents Reply
  • Hi Stefan,

    I tried to used this function in appian and with this regex code value, that replaced leading and trailing spaces to "". 

    regexreplaceall("^\s+|\s+$", ri!targetValue, "")

    However when the value consist of fullwidth space like this "  " -> unicode equilavent to 12288

    Normal half width space is unicode 32.

    It only removes half width space., even using trim function in appian only removes half width space.

    So Im having problem on how to removed also the full width spaces. 

Children