本文整理汇总了TypeScript中angular2/src/facade/lang.StringWrapper类的典型用法代码示例。如果您正苦于以下问题:TypeScript StringWrapper类的具体用法?TypeScript StringWrapper怎么用?TypeScript StringWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StringWrapper类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
() => {
var input = "+angular2 is amazing";
expect(StringWrapper.stripLeft(input, "*")).toEqual(input);
});
示例2: _randomChar
function _randomChar(): string {
return StringWrapper.fromCharCode(97 + Math.floor(Math.random() * 25));
}
示例3: advance
advance() {
this.peek = ++this.index >= this.length ? $EOF : StringWrapper.charCodeAt(this.input, this.index);
}
示例4: expectCharacter
expectCharacter(code: int) {
if (this.optionalCharacter(code)) return;
this.error(`Missing expected ${StringWrapper.fromCharCode(code)}`);
}
示例5: compareIgnoreLang
function compareIgnoreLang(a: string, b: string): number {
return StringWrapper.compare(stripLang(a), stripLang(b));
}
示例6: _insertPolyfillDirectivesInCssText
_insertPolyfillDirectivesInCssText(cssText) {
return StringWrapper.replaceAllMapped(cssText, _cssContentNextSelectorRe, function(m) {
return m[1] + '{';
});
}
示例7: _colonHostPartReplacer
_colonHostPartReplacer(host, part, suffix) {
return host + StringWrapper.replace(part, _polyfillHost, '') + suffix;
}
示例8: _normalizeAttributeName
_normalizeAttributeName(attrName: string): string {
return StringWrapper.startsWith(attrName, 'data-') ? StringWrapper.substring(attrName, 5) :
attrName;
}
示例9: function
ListWrapper.forEach(entries, function(entry) {
var message = Json.parse(entry['message'])['message'];
if (StringWrapper.equals(message['method'], 'Timeline.eventRecorded')) {
ListWrapper.push(records, message['params']['record']);
}
});
示例10: supports
supports(capabilities: {[key: string]: any}): boolean {
return StringWrapper.equals(capabilities['browserName'].toLowerCase(), 'safari');
}