Skip to main content
Solved

Remove Trailing Spaces


Forum|alt.badge.img

Hi there,

I want to remove all spaces after a string. Example:

TestString1[ ]TestString2[   ] 

whereas only the empty spaces after TestString2 should be removed.

I have a solution for removing leading spaces with the StringReplacer which is ^[\s]* but I want to remove only the empty spaces at the end.

Many thanks and kind regards

Thomas

Best answer by jdh

Use an AttributeTrimmer with Trim Type Right and Trim Characters {space}

View original
Did this help you find an answer to your question?

3 replies

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • Best Answer
  • May 25, 2016

Use an AttributeTrimmer with Trim Type Right and Trim Characters {space}


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • May 25, 2016
jdh wrote:

Use an AttributeTrimmer with Trim Type Right and Trim Characters {space}

If you wanted to go the regex route it would be [\\s]*$


Forum|alt.badge.img
  • Author
  • May 25, 2016

Many thanks @jdh The AttributeTrimmer works perfectly! I had forgotten how many wonderfuly transformers FME has on board :) And thank you also for the tip with the regex, have to learn this topic very soon :)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings