Jump to content

Does anyone have a Right Trim function?


Recommended Posts

I'm looking for a function that will only trim spaces on the right side as I have fields where there may be some spaces padding on the left by design.  I'd like to use this function as an auto-enter filter to remove spaces only from the right side of the incoming data.

Link to comment
Share on other sites

27 minutes ago, djc728 said:

only trim spaces on the right side

Here are just 2 ideas that spring to mind:

Let ( [
lastChar = Right ( Trim ( text ) ; 1 ) ;
lastPos = Position ( text ; lastChar ; Length ( text ) ; -1 )
] ;
Left ( text ; lastPos )
)

or:

Let ( 
tmp = Trim ( "a" & text )
;
Replace ( tmp ; 1 ; 1 ; "" )
)

 

  • Like 2
Link to comment
Share on other sites

Thank you.   Well I'll be a monkeys uncle.  ( lol ).   Appreciate it.   We use the MBS plugin for a number of processes.  I don't know what we'd do without it.   Thanks for adding these 2 functions.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.