[Solved] Special character removal from email id


I have a login screen that accepts email and password.

Now in the next screen I want to create a variable that has the email Id, BUT WITHOUT ANY OF THE SPECIAL CHARACTERS. For example, if email is findjhonny-92@gmail.com, I want to extract findjhonny92gmailcom. ( The - and @ are gone). How can I do this?

To explain the logic behind this problem, I need to create a folder in the realtime database for each user. The only constant thing each user has is the email id. So I am trying to create a folder using eMail id but the firebase database name cannot accept special characters. Please help.

@thestrengthinstitute here’s an example that does just that:


You can remix directly from the project detail page here:

Thank you!! That was perfect.

1 Like