Hide
Stay up to dateembedded code automagically updates, each snippet and article has a feed Join Siafoo Now or Learn More

'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// Copyright 2008 Siafoo.net
2// BSD License
3
4String.extend({
5 startsWith: function(string){
6 return this.index(string) == 0
7 }
8})

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.