SyntaxFix
Write A Post
Hire A Developer
Questions
Why use a regex?
name.contains(" ")
That should work just as well, and be faster.