LV_TEXTAREA - How to allow all chars except a space

Hi, I am writing an app where I want the user to enter a passphrase using the keyboard into a text area but I am find it challenging to not have space appear in my text area.
I can see a method called: lv_textarea_set_accepted_chars() but this would mean enter all the chars on the keyboard except a space. I really need the opposite method lv_textarea_set_unaccepted_chars(" ").
I have attached the callback event LV_EVENT_VALUE_CHANGED but how can I actively delete the space chars from the text area during the event callback?
Any help is appreciated.