diff options
author | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-07-23 14:06:11 -0400 |
---|---|---|
committer | alyssaf16 <alyssa_feinberg@brown.edu> | 2024-07-23 14:06:11 -0400 |
commit | e82c95293bb2d9db32fc9901f57f1997b74597c1 (patch) | |
tree | 0c67a0a66fd7d80f1853720400bbf9e5684cb843 /src/extensions/StringExtensions.ts | |
parent | 0b2a8c0d718940ddc06a966d4e027a79bb06ed6e (diff) |
labeling work
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 |