Case-sensitive \'Starts With\'


/ Published in: JavaScript
Save to your folder(s)

A simple Javascript function to tell if one string starts with another.

Usage:

if (myString.startsWith("anything") {
do something…
}


NOTE: As always, make sure this is defined before it is used!

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.