Test for space characters starting at the beginning of a string.

This function is valid in v2.0.0 to v2.24.2. This function has been downloaded 40 times.


{string} str
The string to be tested.
{boolean=} opt_onlyCheckStart Optional, Default:false
If true, only the beginning of the string is checked to see if it starts with a space character. If false, all of the string is checked to see if it only contains space characters.


Returns true if opt_onlyCheckStart is true-ish and str starts with a space character or if opt_onlyCheckStart is false-ish and str only contains space characters. Otherwise false is returned.

Required Function

This function directly requires the following function which is included automatically:

  • isRegExpMatch()
    Determine whether or not a RegExp matches an entire string (or the start of a string).