Hide
Writing an article is easy - try our reStructured Text demo 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.