Remove Text From A Specific Character To Another Character

I have added an error label and when they click the sign-up button, the code runs the signup function and then uses an if statement that says “if there is an error, set the label’s text to the error otherwise, call an alert that shows a message asking to verify the email address”. The funny this is that when I signup with a temporary email for testing like my own Gmail address, it shows an error but still adds the user and send the verification email. I don’t know how but below is a screenshot of what I’ve got for the signup function.

P.S. I have added another test just to remove “Firebase:” from the start of the error.