058e86b4c8
git-svn-id: http://google-refine.googlecode.com/svn/trunk@1032 7d457c2a-affb-35e4-300a-418c747d4874
15 lines
424 B
JavaScript
15 lines
424 B
JavaScript
String.prototype.trim = function() {
|
|
return this.replace(/^\s+/, '').replace(/\s+$/, '');
|
|
};
|
|
|
|
String.prototype.startsWith = function(s) {
|
|
return this.length >= s.length && this.substring(0, s.length) == s;
|
|
};
|
|
|
|
String.prototype.endsWith = function(s) {
|
|
return this.length >= s.length && this.substring(this.length - s.length) == s;
|
|
};
|
|
|
|
String.prototype.contains = function(s) {
|
|
return this.indexOf(s) >= 0;
|
|
}; |