We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 64514db + 58c773a commit ac3d7c9Copy full SHA for ac3d7c9
tagstudio/src/core/utils/web.py
@@ -4,9 +4,7 @@
4
5
def strip_web_protocol(string: str) -> str:
6
"""Strips a leading web protocol (ex. \"https://\") as well as \"www.\" from a string."""
7
- new_str = string
8
- new_str = new_str.removeprefix('https://')
9
- new_str = new_str.removeprefix('http://')
10
- new_str = new_str.removeprefix('www.')
11
- new_str = new_str.removeprefix('www2.')
12
- return new_str
+ prefixes = ['https://','http://','www.','www2.']
+ for prefix in prefixes:
+ string = string.removeprefix(prefix)
+ return string
0 commit comments