How can I check if my string contains a period in JavaScript?

Viewed 49679

I want to be able to detect if a string has a . in it and return true/false based on that.

For example:

"myfile.doc" = TRUE

vs.

"mydirectory" = FALSE;
6 Answers
Related