Removing blanks spaces



Hi,

How would I remove spaces either trailing or following?

For example if I have a variable x = " 10" and I would like to remove the
4 spaces before the 10 so that the variable x = "10".
Also if I again have a variable x = "10 " and I would like to remove the
4 spaces after the 10 so that the variable x = "10".

How would I do that?

TIA

Roy


.