mirror of
https://github.com/TagStudioDev/TagStudio.git
synced 2026-01-29 06:10:51 +00:00
change to string.removeprefix(prefix)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user