diff --git a/src/logic/helper.ts b/src/logic/helper.ts index 146f4d4b6..5a5740560 100644 --- a/src/logic/helper.ts +++ b/src/logic/helper.ts @@ -153,4 +153,18 @@ export function toast(title: string, text: string, img: string, background: stri timerProgressBar: true, color: color }) -} \ No newline at end of file +} + +export function trim(str: string, ch: string) { + let start = 0 + let end = str.length + + while (start < end && str[start] === ch) + ++start; + + while (end > start && str[end - 1] === ch) + --end; + + return (start > 0 || end < str.length) ? str.substring(start, end) : str; + } + \ No newline at end of file diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 22a92de2d..05b725fd4 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -13,9 +13,9 @@