Answer :
For checking if a string contains white space use a matcher and call its find method.
Answer:
^ matches the start of the string.
\s+ means at least 1, possibly more, spaces.
$ matches the end of the string.