Trim spaces form text within a variable

I wish to trim spaces from the text stored in a variable.

I am using an expression to do this and storing the result in another variable

my expression is:

trim(@Variable.AM_Data_Machine , ' ') + trim(@Variable.AM_Data_Equipment , ' ') + '-' + trim(@Variable.AM_Data Location , ' ') + trim(@Variable.AM_Data What_to_Check , ' ')

although the spaces are not removed.

is there any way of removing the spaces within the text stored in a variable.

Many thanks for looking

Trim will remove spaces from the ends. Technical Details of the Expression Editor | Tulip Knowledge Base - Support for Building Operations Apps
You can probably use a substitute to accomplish this.


@mellerbeck hit the nail on the head here, substitute is absolutely the right approach, This is how I would do it.


Many thanks
Worked great