If you simply want the first instance of a certain character, and the context is not more complex, and it doesn't require hyper-optimisation, then just go with source.indexOf(" ")
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you simply want the first instance of a certain character, and the context is not more complex, and it doesn't require hyper-optimisation, then just go with source.indexOf(" ")