From 58c773a0dee48a2541e762ec44cb954c9a2bd517 Mon Sep 17 00:00:00 2001 From: JinguBangWest Date: Fri, 3 May 2024 14:37:32 -0400 Subject: [PATCH] change to string.removeprefix(prefix) --- tagstudio/src/core/utils/web.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tagstudio/src/core/utils/web.py b/tagstudio/src/core/utils/web.py index d42ef782..f1767693 100644 --- a/tagstudio/src/core/utils/web.py +++ b/tagstudio/src/core/utils/web.py @@ -6,6 +6,5 @@ def strip_web_protocol(string: str) -> str: """Strips a leading web protocol (ex. \"https://\") as well as \"www.\" from a string.""" prefixes = ['https://','http://','www.','www2.'] for prefix in prefixes: - if string.startswith(prefix): - string = string.replace(prefix, '') + string = string.removeprefix(prefix) return string