From c1e3caa831c56bbcc2ff272c2ac9e51e868d73a8 Mon Sep 17 00:00:00 2001 From: yorkeking <34937020+yorkeking@users.noreply.github.com> Date: Tue, 4 Apr 2023 01:59:48 +0800 Subject: [PATCH] Update utils.ts --- app/utils.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/utils.ts b/app/utils.ts index 3afe40c61..5fe277c63 100644 --- a/app/utils.ts +++ b/app/utils.ts @@ -1,6 +1,10 @@ import { showToast } from "./components/ui-lib"; import Locale from "./locales"; +export function trimTopic(topic: string) { + return topic.replace(/[,。!?、,.!?]*$/, ""); +} + export async function copyToClipboard(text: string) { try { await navigator.clipboard.writeText(text);