djc728 Posted May 10 Share Posted May 10 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 More sharing options...
MonkeybreadSoftware Posted May 10 Share Posted May 10 I'll add it to the plugin for you: Text.RightTrim and Text.LeftTrim functions. 1 Link to comment Share on other sites More sharing options...
comment Posted May 10 Share Posted May 10 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 ; "" ) ) 2 Link to comment Share on other sites More sharing options...
djc728 Posted May 14 Author Share Posted May 14 Thank you both »» I appreciate it. Love MonkeyBread and @Comment ( big fan ). Thanks. Link to comment Share on other sites More sharing options...
MonkeybreadSoftware Posted May 14 Share Posted May 14 MBS Plugin 14.2 was Released today: Your function wish is included: Text.LeftTrim Trims whitespace on the left side. All ✅ Server Text.RightTrim Trims whitespace on the right side. All ✅ Server 1 Link to comment Share on other sites More sharing options...
djc728 Posted May 14 Author Share Posted May 14 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now