Skip to content

Commit 58c773a

Browse files
committed
change to string.removeprefix(prefix)
1 parent bb1161b commit 58c773a

File tree

1 file changed

+1
-2
lines changed
  • tagstudio/src/core/utils

1 file changed

+1
-2
lines changed

tagstudio/src/core/utils/web.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ def strip_web_protocol(string: str) -> str:
66
"""Strips a leading web protocol (ex. \"https://\") as well as \"www.\" from a string."""
77
prefixes = ['https://','http://','www.','www2.']
88
for prefix in prefixes:
9-
if string.startswith(prefix):
10-
string = string.replace(prefix, '')
9+
string = string.removeprefix(prefix)
1110
return string

0 commit comments

Comments
 (0)