How to remove spaces

You can share your Lua Scripts with everybody here.
Post Reply
DomDis
Posts: 33
Joined: Sat Mar 18, 2023 7:44 pm

How to remove spaces

Post by DomDis »

I have a lua script that pulls the local user_email = user.note_memo field

in this field I have the value "emailone@domain.com, emailtwo@domain.com

local user_email = user.note_memo

I asked support how to remove spaces and got the following reply

Code: Select all

local mSalutation = user_email.gsub(user_email," ", " ")
local mSendTo = user_email.gsub(user_email," ", "")
BUT this does not work. In the email I see   and the space does not get removed do I need to escape   with a \&nsbp; everyting I try does not seem to work and if I type in &nbsp as in local mSendTo = user_email.gsub(user_email," ", "") it get converted to an actual space and so the removing of the space does not work.


I can remove the space in the user.note_memo field but this should work NO ?????
Post Reply