djc728 Posted May 10, 2024 Posted May 10, 2024 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.
MonkeybreadSoftware Posted May 10, 2024 Posted May 10, 2024 I'll add it to the plugin for you: Text.RightTrim and Text.LeftTrim functions. 1
comment Posted May 10, 2024 Posted May 10, 2024 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
djc728 Posted May 14, 2024 Author Posted May 14, 2024 Thank you both »» I appreciate it. Love MonkeyBread and @Comment ( big fan ). Thanks.
MonkeybreadSoftware Posted May 14, 2024 Posted May 14, 2024 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
djc728 Posted May 14, 2024 Author Posted May 14, 2024 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.
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