diff options
author | andrewdkim <adkim414@gmail.com> | 2019-11-12 17:30:02 -0500 |
---|---|---|
committer | andrewdkim <adkim414@gmail.com> | 2019-11-12 17:30:02 -0500 |
commit | fb3a8258298589b911c73c18fdb086c8815e27c8 (patch) | |
tree | c97973e8cc2d828b9ce7486b421fdcf2985c49e2 /src/extensions/StringExtensions.ts | |
parent | 4d4db3aecf54a501a981c239feacdfddfe71152c (diff) | |
parent | ecbe527575bab2cb5f1ced278039ec0a6fc50809 (diff) |
merge from master
Diffstat (limited to 'src/extensions/StringExtensions.ts')
-rw-r--r-- | src/extensions/StringExtensions.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/extensions/StringExtensions.ts b/src/extensions/StringExtensions.ts new file mode 100644 index 000000000..2c76e56c8 --- /dev/null +++ b/src/extensions/StringExtensions.ts @@ -0,0 +1,17 @@ +function Assign() { + + String.prototype.removeTrailingNewlines = function () { + let sliced = this; + while (sliced.endsWith("\n")) { + sliced = sliced.substring(0, this.length - 1); + } + return sliced as string; + }; + + String.prototype.hasNewline = function () { + return this.endsWith("\n"); + }; + +} + +export { Assign };
\ No newline at end of file |