Archived
1
0
Fork 0
This repository has been archived on 2024-04-26. You can view files and clone it, but cannot push or open issues or pull requests.
akari-bot/core/utils/text.py
2023-04-30 11:30:59 +08:00

6 lines
217 B
Python

def remove_suffix(string, suffix):
return string[:-len(suffix)] if string.endswith(suffix) else string
def remove_prefix(string, prefix):
return string[len(prefix):] if string.startswith(prefix) else string