Hide
Solve a problem – Filter by language, license, keyword, owner, or search text to find code & info fast. Join Siafoo Now or Learn More
Note: You are viewing an old version of this snippet. View Latest Version

'Starts With' method for String class Atom Feed 0

In Brief A quick method to see if a string starts with another string. A little nicer than checking if index is zero every time.... more
# 's
1 String.extend({
2 startsWith: function(string){
3 return this.index(string) == 0
4 }
5 })

A quick method to see if a string starts with another string. A little nicer than checking if index is zero every time.

Requires mootools.