input string
search string
position at which to start searching (default: 0)
boolean indicating if the input string starts with the search string
var bool = startsWith( 'Remember the story I used to tell you when you were a boy?', 'Remember' );
// returns true
var bool = startsWith( 'Remember the story I used to tell you when you were a boy?', 'Remember, remember' );
// returns false
var bool = startsWith( 'To be, or not to be, that is the question.', 'To be' );
// returns true
var bool = startsWith( 'To be, or not to be, that is the question.', 'to be' );
// returns false
var bool = startsWith( 'To be, or not to be, that is the question.', 'to be', 14 );
// returns true
var bool = startsWith( 'To be, or not to be, that is the question.', 'quest', -9 );
// returns true
Tests if a string starts with the characters of another string.