decova-dotnet
Version:
This package provides fundumentals that a .net developer may miss while working with Typescript, whether they are missing functinalities or funcionalities provided in a non-elegant design in javascript. Bad naming, bad design of optional parameters, non-c
61 lines • 2.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
require("./String.types");
let XString = require("./XString").XString;
let proto = String.prototype;
proto.xPadRight = function (totalWidth, paddingChar) {
return new XString(this).PadRight(totalWidth, paddingChar).Value;
};
proto.xPadLeft = function (totalWidth, paddingChar) {
return new XString(this).PadLeft(totalWidth, paddingChar).Value;
};
proto.xSubstring = function (startIndex, length) {
return new XString(this).Substring(startIndex, length);
};
proto.xRemove = function (startIndex, length) {
return new XString(this).Remove(startIndex, length).Value;
};
proto.xContains = function (substr) {
return new XString(this).Contains(substr);
};
proto.xInsert = function (index, value) {
return new XString(this).Insert(index, value).Value;
};
proto.xToString = function () {
return this;
};
proto.xIsEmpty = function () {
return new XString(this).IsNullOrEmpty();
};
proto.xIsWhiteSpace = function () {
return new XString(this).IsNullOrWhiteSpace();
};
proto.xStartsWith = function (str) {
return new XString(this).StartsWith(str);
};
proto.xEndsWith = function (str) {
return new XString(this).EndsWith(str);
};
proto.xIndexOf = function (subStr, startSearchFromIndex) {
return new XString(this).IndexOf(subStr, startSearchFromIndex);
};
proto.xLastIndexOf = function (subStr, startSearchFromIndex) {
return new XString(this).LastIndexOf(subStr, startSearchFromIndex);
};
proto.xReplaceOnce = function (toReplace, replacement) {
return new XString(this).ReplaceOnce(toReplace, replacement).Value;
};
proto.xReplaceAll = function (toReplace, replacement) {
return new XString(this).ReplaceAll(toReplace, replacement).Value;
};
let protoConstructor = String;
protoConstructor.xJoin = function (separator, parts) {
return XString.Join(separator, parts).Value;
};
protoConstructor.xIsNullOrWhiteSpace = function (value) {
return new XString(value).IsNullOrWhiteSpace();
};
protoConstructor.xIsNullOrEmpty = function (value) {
return new XString(value).xIsNullOrEmpty();
};
//# sourceMappingURL=String.impl.js.map