消除我特牛
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
1.2 KiB

define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var QueryableString = (function () {
function QueryableString(str) {
this.str = str;
}
QueryableString.prototype.startsWith = function (searchString) {
return this.str.indexOf(searchString) === 0;
};
QueryableString.prototype.endsWith = function (searchString) {
var reverseString = "";
var reverseSearchString = searchString.split("").reverse().join("");
reverseString = this.str.split("").reverse().join("");
return this.startsWith.call({ str: reverseString }, reverseSearchString);
};
QueryableString.prototype.contains = function (searchString) {
return (this.str.indexOf(searchString) !== -1);
};
QueryableString.prototype.equals = function (compareString) {
return this.str === compareString;
};
QueryableString.prototype.value = function () {
return this.str;
};
return QueryableString;
}());
exports.QueryableString = QueryableString;
});